This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Calling strcmp/strncmp/strcasecmp/strncasecmp with NULL parameter
- From: Petter Reinholdtsen <pere at hungry dot com>
- To: Steven Keuchel <steven dot keuchel at freenet dot de>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 17 Aug 2004 23:16:32 +0200
- Subject: Re: Calling strcmp/strncmp/strcasecmp/strncasecmp with NULL parameter
- Bcc: Petter Reinholdtsen <petter dot reinholdtsen at usit dot uio dot no>
- References: <200408172306.07110.steven.keuchel@freenet.de>
[Steven Keuchel]
> What does the C Standard say about this ?
I suggest you have a look at
<URL:http://www.opengroup.org/onlinepubs/009695399/toc.htm>, and
discover that the standard consider it undefined behaviour to call for
example strcmp() with illegal arguments. The code calling strcmp()
like this is broken, and need to be fixed.