about summary refs log tree commit diff
path: root/wcsmbs/mbsrtowcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs/mbsrtowcs.c')
-rw-r--r--wcsmbs/mbsrtowcs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/wcsmbs/mbsrtowcs.c b/wcsmbs/mbsrtowcs.c
index 7ae30b4870..84d4cbf66d 100644
--- a/wcsmbs/mbsrtowcs.c
+++ b/wcsmbs/mbsrtowcs.c
@@ -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)