Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Are bad developer libraries the problem with M$ software?

From: Casper Dik <Casper.Dik(at)Sun.COM>
Date: Mon Nov 18 2002 - 14:36:33 EST

>As a side note, proper use of snprintf would be:

No it would not; the proper 2nd argument is the size of whatever "mystr" points to; for char[] that's sizeof (mystr) (NOT -1) but for char * it's whatever size you alloc'ed.

>Perhaps we should start development of a standardized 'safe' header file

I remember a bug in sendmail caused by bad use of sizef.

>#define safe_strcat(dst,src) =20
> strncat(dst,src,sizeof(dst))

Same problem; not safe anyway. (sizeof (dst) - strlen(dst) - 1, if anything)

Casper Received on Mon Nov 18 22:06:37 2002

Do you need help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:44 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library