diff options
Diffstat (limited to 'wcsmbs/mbrtowc.c')
-rw-r--r-- | wcsmbs/mbrtowc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index 49ca9c2..dbfe940 100644 --- a/wcsmbs/mbrtowc.c +++ b/wcsmbs/mbrtowc.c @@ -59,6 +59,9 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) n = 1; } + if (n == 0) + return (size_t) -2; + /* Tell where we want the result. */ data.__outbuf = outbuf; data.__outbufend = outbuf + sizeof (wchar_t); |