X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsupport%2Fsyserror.cpp;h=f60628840d675189d59d6ccf37ee9ef22d29580c;hb=89997e727ff5d4d8828f6fdaee435d809b623ffe;hp=06ee4eedbda42e77c43565d9d34847609666e1af;hpb=ee0105d74fec9d6bfd236e22e9e1d315e46c568e;p=ctsim.git 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;