Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming a file



On 6/21/07 11:26 AM, Marco Piovanelli said:

>>  strcpy(p, path); //convert to Str255	
>>  buf[0] = strlen(p);
>
>This will fail rather horribly if path is longer than
>255 characters.  Prefer strncpy() over strcpy(), and
>check string lengths.

And prefer strlcpy() over strncpy() over strcpy().

Oh how I wish the compiler would flag the use of these crappy functions...

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Renaming a file (From: Angelo Chen <email@hidden>)
 >Re: Renaming a file (From: "Marco Piovanelli" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.