X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsupport%2Fsyserror.cpp;h=28ccba42036ba329b4626c54fe1e8fa76112f907;hb=e289f8ecb69ba183b32e32ff20f1679f4b62194d;hp=dc3851cbbffb8507884ca8129ed7508d962ae683;hpb=99dd1d6ed10db1f669a5fe6af71225a50fc0ddfb;p=ctsim.git diff --git a/libctsupport/syserror.cpp b/libctsupport/syserror.cpp index dc3851c..28ccba4 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.3 2000/06/19 19:04:05 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,10 +19,11 @@ ******************************************************************************/ #include +#include +#include #include #include -#include "kstddef.h" -#include "cio.h" +#include "ctsupport.h" /* NAME @@ -87,12 +88,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? ";