On Fri, 17 Dec 2004 20:03:33 +0100 Kim Woelders <[EMAIL PROTECTED]>
claimed:
> strncmp cannot simply replace strcmp. There isn't even any point in
> doing so for the reason mentioned here. Segv in strcmp is typically
> because one of the pointers is invalid or NULL, and strncmp will most
> likely segv in exactly the same way.

Fair enough, though generally it seems like neither function really does
the right thing, as strcmp will happily keep comparing memory beyond the
capacity of a buffer, though this isn't really a problem unless there's
already been an overflow...

> strcpy/strncpy is an entirely different matter as they potentially
> overflow the destination buffer.

And the use of strcpy is far more of a concern to me; strcmp just comes
up because it's the function that made me check out the code in the
first place. There are also strcats floating around in there. 

(fwph)

--
Frederick Heckel
[EMAIL PROTECTED]
(The strange attachment is my digital signature; do not be alarmed)

===================================================================
It's raisins that make Post Raisin Bran so raisiny ...

Attachment: pgpxgll119ozD.pgp
Description: PGP signature

Reply via email to