diff options
Diffstat (limited to 'src/multibyte/mbsnrtowcs.c')
-rw-r--r-- | src/multibyte/mbsnrtowcs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/multibyte/mbsnrtowcs.c b/src/multibyte/mbsnrtowcs.c index c6f0207f..f42e30d9 100644 --- a/src/multibyte/mbsnrtowcs.c +++ b/src/multibyte/mbsnrtowcs.c @@ -47,6 +47,10 @@ size_t mbsnrtowcs(wchar_t *wcs, const char **src, size_t n, size_t wn, mbstate_t cnt = l; break; } + if (!l) { + s = 0; + break; + } /* have to roll back partial character */ *(unsigned *)st = 0; break; |