X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Fsyserror.cpp;h=b5981b1c16fd7f5928706370516c7a5701dab844;hp=dc3851cbbffb8507884ca8129ed7508d962ae683;hb=5cf6874680f80d238bf34535d711dc223813f951;hpb=007a78a5e3a043cbc7e2777ab033b81b8acbbe71 diff --git a/libctsupport/syserror.cpp b/libctsupport/syserror.cpp index dc3851c..b5981b1 100644 --- a/libctsupport/syserror.cpp +++ b/libctsupport/syserror.cpp @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: syserror.cpp,v 1.1 2000/06/19 02:58:08 kevin Exp $ +** $Id: syserror.cpp,v 1.2 2000/06/19 17:58:20 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -19,6 +19,8 @@ ******************************************************************************/ #include +#include +#include #include #include #include "kstddef.h" @@ -87,12 +89,12 @@ void sys_verror (int severity, const char *msg, va_list arg) sys_error (ERR_FATAL, "illegal error code #%d [sys_error]", severity); } - vfprintf (stdout, msg, arg); - - cout << "\n"; + char errStr[512]; + vsnprintf (errStr, sizeof(errStr), msg, arg); + cout << errStr << endl; if (severity == ERR_FATAL) - exit(1); + throw runtime_error (errStr); #if INTERACTIVE_ERROR_DISPLAY cout << "A - Abort C - Continue W - Turn off warnings? ";