delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/09/02/11:01:57

Date: 02 Sep 2003 14:33:23 +0200
Message-Id: <uisobid4c.fsf@elta.co.il>
From: Eli Zaretskii <eliz AT elta DOT co DOT il>
To: "Melvin Curran" <Melvin AT HME DOT Ltd DOT uk>
CC: djgpp-workers AT delorie DOT com
In-reply-to: <F1A9C8D7A58D1B45A9C16FE7E3DA83D702188F@server.HME.hme.ltd.uk>
(Melvin AT HME DOT Ltd DOT uk)
Subject: Re: Non-compliant strxfrm
References: <F1A9C8D7A58D1B45A9C16FE7E3DA83D702188F AT server DOT HME DOT hme DOT ltd DOT uk>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019