diff options
author | Andre Heider | 2010-08-25 17:03:24 +0000 |
---|---|---|
committer | Andre Heider | 2010-08-25 17:03:24 +0000 |
commit | 088da9e698f64343b33763c6af52bde02e7e3750 (patch) | |
tree | 95c56c5c11853ce6694ad95a5dfc7a49b9c6cfe5 | |
parent | 05c2cc4d1d15fbf4c7a4997b83f60978164a7110 (diff) | |
download | scummvm-rg350-088da9e698f64343b33763c6af52bde02e7e3750.tar.gz scummvm-rg350-088da9e698f64343b33763c6af52bde02e7e3750.tar.bz2 scummvm-rg350-088da9e698f64343b33763c6af52bde02e7e3750.zip |
HUGO: Fix invalid usage of snprintf with va_args
svn-id: r52390
-rw-r--r-- | engines/hugo/util.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index ad7b9fe39e..da917a802e 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -122,12 +122,12 @@ void Utils::Warn(bool technote, const char *format, ...) { 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 @@ void Utils::Error(int error_type, const char *format, ...) { 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); |