On Mar 18, 2009, at 11:22 PM, Stuart Jansen wrote:

> On Wed, 2009-03-18 at 22:05 -0600, Grant Robinson wrote:
>> char *myCString = new char[50];
>> strcpy(myCString, "My C string");
>
> Friends don't let friends use strcpy().

I simply rewrote his code in a way that won't crash for that  
particular string.

Unchecked strcpy's are the root of many a buffer overflow attack.

Consider yourself warned. :)

Grant

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to