> On Aug 3, 2017, at 04:48, Ed Schouten <[email protected]> wrote: > > 2017-08-03 7:27 GMT+02:00 Ngie Cooper <[email protected]>: >> 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
signature.asc
Description: Message signed with OpenPGP using GPGMail
