The following reply was made to PR kern/181153; it has been noted by GNATS.
From: Andrey Chernov <[email protected]> To: Garrett Cooper <[email protected]> Cc: [email protected] Subject: Re: bin/181153: sscanf doesn't skip whitespace properly Date: Fri, 09 Aug 2013 05:24:20 +0400 On 09.08.2013 4:23, Garrett Cooper wrote: > ATF_TC_BODY(sscanf_whitespace, tc) > { > const char str[] = "\f\n\r\t\v%z"; > char c; > > /* set of "white space" symbols from isspace(3) */ > c = 0; > (void)sscanf(str, "%%%c", &c); > ATF_REQUIRE(c == 'z'); > } I doubt this exampe should skip whitespace. POSIX says: "A directive that is an ordinary character shall be executed as follows: the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread." %% is the ordinary % character and no isspace(3) skipping mentioned in this explanation. -- http://ache.vniz.net/ bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
