Make sure SRC argument is correct when partial character is read.
authordrepper <drepper>
Wed, 26 Nov 1997 04:20:13 +0000 (04:20 +0000)
committerdrepper <drepper>
Wed, 26 Nov 1997 04:20:13 +0000 (04:20 +0000)
wcsmbs/mbsrtowcs.c

index 7ae30b4..84d4cbf 100644 (file)
@@ -52,7 +52,12 @@ __mbsrtowcs (dst, src, len, ps)
     {
       wchar_t value;
       size_t count;
-      unsigned char byte = *run++;
+      unsigned char byte;
+
+      /* Store address of next byte to process.  */
+      *src = run;
+
+      byte = *run++;
 
       /* We expect a start of a new multibyte character.  */
       if (byte < 0x80)