mbsinit: Don't crash for a NULL argument.
[gnulib.git] / lib / mbsinit.c
index c08695c..869c0a6 100644 (file)
@@ -43,5 +43,5 @@ mbsinit (const mbstate_t *ps)
 {
   const char *pstate = (const char *)ps;
 
-  return pstate[0] == 0;
+  return pstate == NULL || pstate[0] == 0;
 }