??????C?????У??????????????????Σ??д?????ú??????????????????????鼮?????????????????C???????????Σ?????????????????????δ????????????????????printf?????????????κ??????????????????????????????????????????????????????????????

??????κ??????????????????????????ν???????????????????????????????????????????????????????????debug??syslog????????????????????頂0bug-C/C++???ù???????????棬??????????????????????????????????C??????и??????????????Ρ?

??????????????C?????κ??????????Ч?????????????????????????????????????????????????????????????????????????????????????κ??????????????????????????????????????κ???????????????????share??£??????ο???

??????????仰???????????????????

??????????????????????頂0bug-C/C++???ù??????????????????????δ??????????????????????????????????????SafePrintf?????????????????????ж?????????????????“????????”???

????Code??

int SafePrintf(char* szBuf??int nMaxLength??char *szFormat?? ...)  
{  
    int nListCount=0;  
    va_list pArgList;  
 
    if (!szBuf) goto SafePrintf_END_PROCESS;  
    va_start (pArgList??szFormat);  
    nListCount+=Linux_Win_vsnprintf(szBuf+nListCount??  
        nMaxLength-nListCount??szFormat??pArgList);  
    va_end(pArgList);  
    if(nListCount>(nMaxLength-1)) nListCount=nMaxLength-1;  
    *(szBuf+nListCount)='