[Cppunit-cvs] cppunit2/include/cpptl stringtools.h,1.8,1.9
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2006-02-01 18:26:28
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10035/include/cpptl Modified Files: stringtools.h Log Message: * worked-around security deprecation warning on VC++ 2005. Index: stringtools.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/stringtools.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** stringtools.h 2 Jul 2005 20:27:35 -0000 1.8 --- stringtools.h 1 Feb 2006 18:26:16 -0000 1.9 *************** *** 181,185 **** #endif // #ifdef FLT_DIG char buffer[128]; ! sprintf(buffer, "%.*g", precision, v ); return buffer; } --- 181,189 ---- #endif // #ifdef FLT_DIG char buffer[128]; ! #ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning. ! sprintf_s(buffer, sizeof(buffer), "%.*g", precision, v); ! #else ! sprintf(buffer, "%.*g", precision, v); ! #endif return buffer; } *************** *** 193,197 **** #endif // #ifdef DBL_DIG char buffer[128]; ! sprintf(buffer, "%.*g", precision, v ); return buffer; } --- 197,205 ---- #endif // #ifdef DBL_DIG char buffer[128]; ! #ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning. ! sprintf_s(buffer, sizeof(buffer), "%.*g", precision, v); ! #else ! sprintf(buffer, "%.*g", precision, v); ! #endif return buffer; } *************** *** 205,209 **** #endif // #ifdef DBL_DIG char buffer[128]; ! sprintf(buffer, "%.*g", precision, v ); return buffer; } --- 213,221 ---- #endif // #ifdef DBL_DIG char buffer[128]; ! #ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning. ! sprintf_s(buffer, sizeof(buffer), "%.*g", precision, v); ! #else ! sprintf(buffer, "%.*g", precision, v); ! #endif return buffer; } |