Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Aug 2017 13:48:41 +0200
From:      Ed Schouten <ed@nuxi.nl>
To:        Ngie Cooper <ngie@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
Message-ID:  <CABh_MKnXdD32h1nTq=GSpdrxxrSmQzyZ8=np9z4EGqzH65Tqzw@mail.gmail.com>
In-Reply-To: <201708030527.v735R5dg041043@repo.freebsd.org>
References:  <201708030527.v735R5dg041043@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2017-08-03 7:27 GMT+02:00 Ngie Cooper <ngie@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@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABh_MKnXdD32h1nTq=GSpdrxxrSmQzyZ8=np9z4EGqzH65Tqzw>