Mail Archives: djgpp-workers/2003/09/02/11:01:57
> Date: Tue, 2 Sep 2003 09:37:41 +0100
> From: "Melvin Curran" <Melvin AT HME DOT Ltd DOT uk>
>
> The only thing bothering me now is the the statement in the standard
> that says "If n is zero, dst is permitted to be a null pointer."
> Does this imply that if n isn't zero then dst must point to something?
It implies that if n is zero, the function's code _must_not_
dereference dst. Otherwise, it _can_ dereference dst, and if it does,
what follows depends on the underlying OS and runtime environment; on
most systems (including DJGPP), the program will crash and burn.
In other words, if n is not zero, you get the same as what you get
with other string functions, like strcpy, if one of its arguments is a
NULL pointer.
- Raw text -