avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] scanf: What about to consider the NUL as end of string?


From: Dmitry K.
Subject: [avr-libc-dev] scanf: What about to consider the NUL as end of string?
Date: Mon, 11 Feb 2008 16:51:43 +1000
User-agent: KMail/1.5

Hi.

The question is about the NUL character ('\0') with
string conversions ('%s', '%[^').  Now the Avr-libc's
scanf() considers the NUL as a normal character: it is
placed into output buffer and a conversion continues.

The GNU's libc does the same.

Is it a good behavior?  What about to stop conversion after
the NUL is readed?

Any links?

For '%[' (without '^') conversion it is not a problem,
as '\0' is in block-list by default.

Note, in case of '%[^' conversion it is no way to place
the NUL into block-list (it would be the end of format
string).

Thanks,
Dmitry.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]