]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_IO_vsnprintf): Set first byte of destination array to NUL to handle
authorUlrich Drepper <drepper@redhat.com>
Fri, 28 Aug 1998 12:06:13 +0000 (12:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 28 Aug 1998 12:06:13 +0000 (12:06 +0000)
maxlen==1 case correctly.

libio/vsnprintf.c

index af901bf3e67a2471c6ee02e167346d9709cec147..c95b2fc7ba0f0d0e1ef466b12b74b59d82ef7319 100644 (file)
@@ -45,6 +45,7 @@ _IO_vsnprintf (string, maxlen, format, args)
 
   _IO_init ((_IO_FILE *) &sf, 0);
   _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
+  string[0] = '\0';
   _IO_str_init_static ((_IO_FILE *) &sf, string, maxlen - 1, string);
   ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
   *((_IO_FILE *) &sf)->_IO_write_ptr = '\0';