On Wed, Jun 25, 2008 at 09:39:55AM -0700, Garrett D'Amore wrote: > Is the next step really to start checking for null arguments to other > string functions? What about null pointers passed to other library > routines, such as free(), qsort(), bsearch()?
free(NULL) is already allowed, always. To provide a general answer: if it were to turn out that, say, strlen(NULL) "works" (e.g., returns 0) on Linux and *BSD and that *many* applications depend on this behaviour, then we may have to consider making our strlen() do the same. If this were to violate some standard, then that will complicate the decision process -- we may need to resort to compile-/link-time behaviour selections (for libraries and executables both).
