Click here to Skip to main content
       

ATL / WTL / STL

 
GeneralRe: CAsyncSocket Connect says in use Pinmemberpasztorpisti16-Sep-12 13:34 
GeneralRe: CAsyncSocket Connect says in use [modified] Pinmemberbkelly1316-Sep-12 14:07 
Questionbetter version of strcpy() and printf() Pinmemberbkelly1315-Sep-12 10:02 
AnswerRe: better version of strcpy() and printf() PinmentorPaul Watt15-Sep-12 12:33 
GeneralRe: better version of strcpy() and printf() Pinmemberbkelly1315-Sep-12 15:34 
GeneralRe: better version of strcpy() and printf() PinmentorPaul Watt15-Sep-12 15:45 
GeneralRe: better version of strcpy() and printf() Pinmemberbkelly1315-Sep-12 16:23 
GeneralRe: better version of strcpy() and printf() Pinmemberpasztorpisti16-Sep-12 6:54 
I think both strncpy() and snprintf() sucks. Once I searched for hours for a bug that was caused by strncpy(). Here is the problem: strncpy() is suboptimal because even if you copy a 1 byte string, it fills the whole remaining part of the destination buffer with zeros unnecessarily, and on the other hand it doesn't zero terminate the string if its length equals to or bigger than the size of the dest buffer. The missing zero terminator character in similar cases is true for snprintf() too. I highly discourage everyone from using these functions.
GeneralRe: better version of strcpy() and printf() PinmvpRichard MacCutchan16-Sep-12 0:10 
AnswerRe: better version of strcpy() and printf() PinmemberRichard Andrew x6415-Sep-12 17:01 
AnswerRe: better version of strcpy() and printf() PinmvpRichard MacCutchan16-Sep-12 0:09 
AnswerRe: better version of strcpy() and printf() Pinmemberpasztorpisti16-Sep-12 1:37 
AnswerRe: better version of strcpy() and printf() PinmemberStephen Hewitt18-Sep-12 0:29 
Questionget a number into static text control Pinmemberbkelly1313-Sep-12 17:05 
AnswerRe: get a number into static text control PinmvpRichard MacCutchan13-Sep-12 21:52 
GeneralRe: get a number into static text control Pinmemberbkelly1314-Sep-12 15:00 
GeneralRe: get a number into static text control PinmentorPaul Watt14-Sep-12 15:36 
GeneralRe: get a number into static text control PinmvpRichard MacCutchan14-Sep-12 23:02 
GeneralRe: get a number into static text control Pinmemberbkelly1315-Sep-12 5:14 
GeneralRe: get a number into static text control PinmvpRichard MacCutchan15-Sep-12 5:42 
QuestionMirroring system imagelist Pinmemberhuzifa3011-Sep-12 15:27 
QuestionCAsyncSocket, first application [modified] Pinmemberbkelly139-Sep-12 5:26 
AnswerRe: CAsyncSocket, first application PinmentorPaul Watt14-Sep-12 15:47 
QuestionAfxGetThread vs GetCurrentThreadID Pinmemberkishorekumarnaik6-Sep-12 6:52 
AnswerRe: AfxGetThread vs GetCurrentThreadID PinmemberJiří Miklík7-Sep-12 0:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 15 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid