| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 2006-04-05 01:15, John Draper said:void
infoServer::setExtIP(char *ip)
{
if (m_MyExtIP == NULL) {
m_MyExtIP = new char(100);
}
strcpy(m_MyExtIP, ip); <---- This causes the crash. The size of
the string is 16 bytes
}
In addition to what others have said, I would recommend you never never
never use strcpy(), use strncpy() instead, it takes a length parameter.
Though it may not have helped you here, it is good practice. You will
be less likely to have buffer overruns.
-Prachi _______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden
| References: | |
| >I confirmed ONE problem - not sure how to fix it though. (From: John Draper <email@hidden>) | |
| >Re: I confirmed ONE problem - not sure how to fix it though. (From: "Sean McBride" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.