[Scummvm-cvs-logs] SF.net SVN: scummvm:[52390] scummvm/trunk/engines/hugo/util.cpp
dhewg at users.sourceforge.net
dhewg at users.sourceforge.net
Wed Aug 25 19:03:25 CEST 2010
Revision: 52390
http://scummvm.svn.sourceforge.net/scummvm/?rev=52390&view=rev
Author: dhewg
Date: 2010-08-25 17:03:24 +0000 (Wed, 25 Aug 2010)
Log Message:
-----------
HUGO: Fix invalid usage of snprintf with va_args
Modified Paths:
--------------
scummvm/trunk/engines/hugo/util.cpp
Modified: scummvm/trunk/engines/hugo/util.cpp
===================================================================
--- scummvm/trunk/engines/hugo/util.cpp 2010-08-25 14:43:42 UTC (rev 52389)
+++ scummvm/trunk/engines/hugo/util.cpp 2010-08-25 17:03:24 UTC (rev 52390)
@@ -122,12 +122,12 @@
va_start(marker, format);
vsnprintf(buffer, WARNLEN, format, marker);
+ va_end(marker);
//// if (technote)
//// strcat (buffer, sTech);
//MessageBeep(MB_ICONEXCLAMATION);
//MessageBox(hwnd, buffer, "HugoWin Warning", MB_OK | MB_ICONEXCLAMATION);
warning("Hugo warning: %s", buffer);
- va_end(marker);
//sndPlaySound(NULL, 0); // Stop beep and restore sound
@@ -175,11 +175,11 @@
HugoEngine::get().shutdown(); // Restore any devices before exit
va_start(marker, format);
- snprintf(&buffer[strlen(buffer)], ERRLEN - strlen(buffer), format, marker);
+ vsnprintf(&buffer[strlen(buffer)], ERRLEN - strlen(buffer), format, marker);
+ va_end(marker);
//MessageBeep(MB_ICONEXCLAMATION);
//MessageBox(hwnd, buffer, "HugoWin Error", MB_OK | MB_ICONEXCLAMATION);
warning("Hugo Error: %s", buffer);
- va_end(marker);
if (fatal)
exit(1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list