STRLEN(NULL)

STRLEN(NULL)

Post by P. da Sil » Sat, 10 Jun 1995 04:00:00



Hi,

Shouldn't strlen("") or strlen(NULL) return 0?

What does ANSI say about this?

Thanx
Paulo

 
 
 

STRLEN(NULL)

Post by Paul Koning 169 » Sat, 10 Jun 1995 04:00:00


Quote:>Shouldn't strlen("") or strlen(NULL) return 0?

strlen("") should be zero.  strlen(NULL) is a program error, since you're
not supposed
to pass a null pointer to it.  (A null pointer is something completely
different
from a pointer to a null string.)

     paul

 
 
 

STRLEN(NULL)

Post by Paal-Kr. Engst » Sat, 10 Jun 1995 04:00:00



|> Hi,
|>
|> Shouldn't strlen("") or strlen(NULL) return 0?
|>
|> What does ANSI say about this?

strlen("") must return 0.
strlen(NULL) is *undefined* in ANSI and is very dangerous!
It actually crashes some OS's. Always check null pointers.

|> Thanx
|> Paulo
|>
|>

PKE.

 
 
 

1. network with null modem/reseau par null modem

Hi all
i ve tryed intersrv and interlnk to connect my 2 pc
it work fine but the serveur cant do anything when it runs
i would like to find a soft who can do the same thing that interlnk and
intersrv BUT who are resident in memory so i can do other stuff
thanks a lot
---------
Salut tout le monde
j ai essaye intersrv et interlnk pour connecter mes 2 ^pc
ca marche bien mais le serveur ne peut rien faire d autre pendant que c
est connecte
je voudrais trouver un soft qui peut faire la meme chose comme intersrv
et interlnk MAIS qui sont resident en memoire pour que je puisse faire
autre chose pendant ce temps la
merci beaucoup

--
TaZ
icq: 24783179
site: http://altern.org/qtaz

2. Batch separator sheets

3. Null pointer cast to far is not null

4. A class factory exercise: looking for others to code review...

5. @FileRead problem with null character(s)

6. Concurrent Distribution of Files to Site Servers

7. 4NT Prerelease: @LFN[C:\] returns null string

8. GENERATE NUMBERS FROM WORKSPACE

9. Null character aborts batch files in 4dos 5.51B

10. delete NULL?

11. strcmp("anything",NULL) -> error ??

12. fwd: strcmp("anything",NULL) -> error ??