* wcsmbs/wcsnrtombs.c (__wcsnrtombs): Create temporary state object cvs/fedora-glibc-20090102T2040 cvs/fedora-glibc-20090102T2110
authorUlrich Drepper <drepper@redhat.com>
Fri, 2 Jan 2009 19:28:55 +0000 (19:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 2 Jan 2009 19:28:55 +0000 (19:28 +0000)
if no output is written.

ChangeLog
wcsmbs/wcsnrtombs.c

index a7e2db017e6c8068ab1e9056be78226df59048ef..450a5b609220aaafd07bcad70bf3b7085d18d637 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
 
+       * wcsmbs/wcsnrtombs.c (__wcsnrtombs): Create temporary state object
+       if no output is written.
+
        * version.h: Bump to 2.10 development.
 
        * posix/getconf.c: Update copyright year.
index 171fc3c227f4c6e0ebd4901c740c17e70297b23d..eead26fb3cc4edac5b187e8c915f31267e7d6c15 100644 (file)
@@ -77,10 +77,14 @@ __wcsnrtombs (dst, src, nwc, len, ps)
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
     {
+      mbstate_t temp_state;
       unsigned char buf[256];          /* Just an arbitrary value.  */
       const unsigned char *inbuf = (const unsigned char *) *src;
       size_t dummy;
 
+      temp_state = *data.__statep;
+      data.__statep = &temp_state;
+
       result = 0;
       data.__outbufend = buf + sizeof (buf);