mbsinit: Don't crash for a NULL argument.
[pspp] / lib / mbsinit.c
index c08695ce24666dee5d46b37573108c7d71c791d5..869c0a6ab9e542c372a17282e1ee70df124f0ea6 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;
 }