On 11/06/2015 09:45 AM, Mathieu Malaterre wrote:
> Package: manpages-dev
> Version: 3.74-1
> 
> Currently `man sscanf`` reads as:
> 
> [...]
> RETURN VALUE
>        These functions return the number of input items successfully
> matched and assigned, which can be fewer than provided for, or even
> zero in the event of an early matching failure.
> [...]
> 
> This is incorrect in case a read failure occurs before the first
> receiving argument. cppreference reads as (suggested change):
> 
> [...]
> Return value
> 
> Number of receiving arguments successfully assigned, or EOF if read
> failure occurs before the first receiving argument was assigned.
> [...]
> 
> ref: http://en.cppreference.com/w/cpp/io/c/fscanf
> 
> example:
> 
> [...]
> int i;
> int n = sscanf( "ABC", "ABCD%d", &i ); // n -> EOF
> [...]

[Upstream maintainer here]

I'm puzzled. Isn't the information you require covered in the
very *next* paragraph of the manual page:

       The value EOF is returned if the end of input is reached before
       either the first successful conversion or  a  matching  failure
       occurs.   EOF is also returned if a read error occurs, in which
       case the error indicator for the stream (see ferror(3)) is set,
       and errno is set to indicate the error.

?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

Reply via email to