F
Fred L. Kleinschmidt
What does the standard say about a NULL value being passed to strcmp?
For example,
static char *s1 = "xxx";
static char *s2=NULL;
int n = strcmp(s1,s2);
Should this be legal, or is it UB?
My HP handles it OK - the man page says it considers NULL values the
same as empty strings.
My Sun Solaris crashes - its man page says nothing about NULL values.
For example,
static char *s1 = "xxx";
static char *s2=NULL;
int n = strcmp(s1,s2);
Should this be legal, or is it UB?
My HP handles it OK - the man page says it considers NULL values the
same as empty strings.
My Sun Solaris crashes - its man page says nothing about NULL values.