svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
Ed Schouten
ed at nuxi.nl
Thu Aug 3 11:49:13 UTC 2017
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.
--
Ed Schouten <ed at nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
More information about the svn-src-all
mailing list