comparison tests/test-mbsinit.c @ 14344:5cdebc45677d

mbsinit: Don't crash for a NULL argument. * lib/mbsinit.c (mbsinit): When the argument is NULL, return 1. * tests/test-mbsinit.c (mbsinit): Check this behaviour.
author Bruno Haible <bruno@clisp.org>
date Sun, 13 Feb 2011 18:04:55 +0100
parents 97fc9a21a8fb
children 8250f2777afc
comparison
equal deleted inserted replaced
14343:8e4360837451 14344:5cdebc45677d
30 int 30 int
31 main (int argc, char *argv[]) 31 main (int argc, char *argv[])
32 { 32 {
33 static mbstate_t state; 33 static mbstate_t state;
34 34
35 ASSERT (mbsinit (NULL));
36
35 ASSERT (mbsinit (&state)); 37 ASSERT (mbsinit (&state));
36 38
37 if (argc > 1) 39 if (argc > 1)
38 { 40 {
39 static const char input[1] = "\303"; 41 static const char input[1] = "\303";