This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: strlen on a NULL
- To: Michael Hirmke <mh at mike dot franken dot de>
- Subject: Re: strlen on a NULL
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Date: Fri, 15 May 1998 23:05:16 +1000
- Cc: gnu-win32 at cygnus dot com
- References: <H00000b00005bfcb@MHS> <6tl3-Ka4pfB@mike.franken.de>
On 13-May-1998, Michael Hirmke <mh@mike.franken.de> wrote:
> Valery Fine [fine@bnl.gov] wrote:
>
> >On 12 May 98 at 13:42, Kjeld.F.Christensen@dxd.erics wrote:
> >
> >> On NT your process may lie anywhere, but never in ZERO, Thus you are
> >> not permitted to read from adress NULL. (You are not allowed to
> >> snoop around in the interrupt vetors!)
> >
> > Some int strlen(char *s) is started with
> >
> > int strlen(char *s){
> > if (s==0) return 0;
> ^
> *This is really incorrect behaviour* !
No, the behaviour in this case is UNDEFINED -- that means that
ANY behaviour is correct behaviour.
Of course, strlen() should be
size_t strlen(const char *s)
not
int strlen(char *s)
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".