X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Fsyserror.cpp;h=f60628840d675189d59d6ccf37ee9ef22d29580c;hp=06ee4eedbda42e77c43565d9d34847609666e1af;hb=855f0990a75750c61badd376ff35ffb39fab1c36;hpb=aa41f74ce0ec15bc7952ed9da629dbe294429a61 diff --git a/libctsupport/syserror.cpp b/libctsupport/syserror.cpp index 06ee4ee..f606288 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.7 2000/12/06 01:46:43 kevin Exp $ +** $Id: syserror.cpp,v 1.8 2000/12/17 23:30:48 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 @@ -88,11 +88,14 @@ void sys_verror (int severity, const char *msg, va_list arg) std::cout << "Illegal error code #" << severity << ": "; } - char errStr[512]; + char errStr[512]; + #if HAVE_VSNPRINTF vsnprintf (errStr, sizeof(errStr), msg, arg); #elif HAVE_VSPRINTF - vsprintf (errStr, msg, arg); + vsprintf (errStr, msg, arg); +#else + strncpy (errStr, sizeof(errStr), "Error message not available on this platform."); #endif std::cout << errStr << std::endl;