From: Ulrich Drepper Date: Fri, 14 Dec 2001 07:19:20 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2-3~1288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13c5a4420b0479b07c0efa11d985e4e59dcc369d;p=thirdparty%2Fglibc.git Update. 2001-12-13 Ulrich Drepper * stdio-common/tst-sprintf.c: New file. 2001-12-13 Andreas Schwab * stdio-common/vfprintf.c (process_string_arg): Correctly handle zero precision with wide character string format. --- diff --git a/ChangeLog b/ChangeLog index 95e10239af2..d9bccb934d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-12-13 Ulrich Drepper + + * stdio-common/tst-sprintf.c: New file. + +2001-12-13 Andreas Schwab + + * stdio-common/vfprintf.c (process_string_arg): Correctly handle + zero precision with wide character string format. + 2001-12-13 Thorsten Kukuk * sysdeps/posix/cuserid.c (cuserid): If we don't find the UID, diff --git a/stdio-common/tst-sprintf.c b/stdio-common/tst-sprintf.c new file mode 100644 index 00000000000..afbacd90375 --- /dev/null +++ b/stdio-common/tst-sprintf.c @@ -0,0 +1,19 @@ +#include +#include + + +int +main (void) +{ + char buf[100]; + int result = 0; + + if (sprintf (buf, "%.0ls", L"foo") != 0 + || strlen (buf) != 0) + { + puts ("sprintf (buf, \"%.0ls\", L\"foo\") produced some output\n"); + result = 1; + } + + return result; +} diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index c5e78c74999..febd0947290 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1195,7 +1195,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) \ memset (&mbstate, '\0', sizeof (mbstate_t)); \ \ - if (prec > 0) \ + if (prec >= 0) \ { \ /* The string `s2' might not be NUL terminated. */ \ if (prec < 32768 \