svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2

Ngie Cooper (yaneurabeya) yaneurabeya at gmail.com
Thu Aug 3 12:45:17 UTC 2017


> On Aug 3, 2017, at 04:48, Ed Schouten <ed at nuxi.nl> wrote:
> 
> 2017-08-03 7:27 GMT+02:00 Ngie Cooper <ngie at freebsd.org>:
>> Modified: head/sys/boot/arm/at91/libat91/printf.c
>> ==============================================================================
>> --- head/sys/boot/arm/at91/libat91/printf.c     Thu Aug  3 03:45:48 2017        (r321968)
>> +++ head/sys/boot/arm/at91/libat91/printf.c     Thu Aug  3 05:27:05 2017        (r321969)
>> @@ -20,12 +20,13 @@
>> #include <stdarg.h>
>> #include "lib.h"
>> 
>> -void
>> +int
>> printf(const char *fmt,...)
>> {
>>        va_list ap;
>>        const char *hex = "0123456789abcdef";
>>        char buf[10];
>> +       const char *fmt_orig = fmt;
>>        char *s;
>>        unsigned u;
>>        int c;
>> @@ -66,5 +67,5 @@ printf(const char *fmt,...)
>>        }
>>        va_end(ap);
>> 
>> -       return;
>> +       return (int)(fmt - fmt_orig);
>> }
> 
> This makes printf() return the number of characters from the format
> processed, right? This is different from libc's printf(), which
> returns the number of characters printed.

	Yes. markj identified flaws with my approach that need to be addressed in another commit (unfortunately I didn’t pay close enough attention to the details when I implemented the change).
Thanks,
-Ngie

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170803/1e3f2977/attachment.sig>


More information about the svn-src-head mailing list