[pywin32-checkins] pywin32/Pythonwin win32win.cpp,1.19,1.20
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-02-24 15:47:16
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30183 Modified Files: win32win.cpp Log Message: Fix format string in repr() to prevent a crash Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** win32win.cpp 10 Feb 2008 06:20:51 -0000 1.19 --- win32win.cpp 24 Feb 2008 15:47:20 -0000 1.20 *************** *** 3253,3263 **** { CString csRet; ! char *buf = csRet.GetBuffer(40); UINT_PTR numMsg = pMessageHookList ? pMessageHookList->GetCount() : 0; UINT_PTR numKey = pKeyHookList ? pKeyHookList->GetCount() : 0; char *hookStr = obKeyStrokeHandler ? " (AllKeys Hook Active)" : ""; ! sprintf(buf, ", mh=%I, kh=%I%s", numMsg, numKey, hookStr); ! csRet.ReleaseBuffer(-1); ! return PyCCmdTarget::repr() + csRet; } --- 3253,3262 ---- { CString csRet; ! CString base_repr = PyCCmdTarget::repr(); UINT_PTR numMsg = pMessageHookList ? pMessageHookList->GetCount() : 0; UINT_PTR numKey = pKeyHookList ? pKeyHookList->GetCount() : 0; char *hookStr = obKeyStrokeHandler ? " (AllKeys Hook Active)" : ""; ! csRet.Format("%s, mh=%Iu, kh=%Iu%s", (const char *)base_repr, numMsg, numKey, hookStr); ! return csRet; } |