Mail Archives: djgpp/1994/10/31/09:15:05
> The C library string functions have an unstated precondition that string
> pointers are not NULL. It is up to the user to ensure this. strcat() will not
> test your arguments.
My ansi reference (not quite the official one, but a summary reference) states:
"If an argument to a library function has a pointer type, then the
value of the argument expression must be a valid address for a data
object of its type. This is true even if the library function has no
need to access a data object by using the pointer argument."
The example they give includes this line:
strcpy(s1, NULL) is INVALID
- Raw text -