summaryrefslogtreecommitdiff
path: root/wcsmbs/wcsnrtombs.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs/wcsnrtombs.c')
-rw-r--r--wcsmbs/wcsnrtombs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wcsmbs/wcsnrtombs.c b/wcsmbs/wcsnrtombs.c
index 171fc3c227..eead26fb3c 100644
--- a/wcsmbs/wcsnrtombs.c
+++ b/wcsmbs/wcsnrtombs.c
@@ -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);