From 32e76e88cf8cdb1929a4618811e1c57c0948f466 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 22 Jan 2003 05:03:51 +0000 Subject: [PATCH] Updated. committer: mfx 1043211831 +0000 --- src/except.cpp | 17 ++++++++++++----- src/snprintf.cpp | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/except.cpp b/src/except.cpp index ed8393a0..8e636b15 100644 --- a/src/except.cpp +++ b/src/except.cpp @@ -177,11 +177,18 @@ void throwEOFException(const char *msg, int e) const char *prettyName(const char *n) { if (n == NULL) - return ""; - while (*n >= '0' && *n <= '9') // gcc - n++; - if (strncmp(n, "class ", 6) == 0) // Visual C++ - n += 6; + return "(null)"; + while (*n) + { + if (*n >= '0' && *n <= '9') // Linux ABI + n++; + else if (*n == ' ') + n++; + else if (strncmp(n, "class ", 6) == 0) // Visual C++ + n += 6; + else + break; + } return n; } diff --git a/src/snprintf.cpp b/src/snprintf.cpp index c05450b2..3ddd0a8b 100644 --- a/src/snprintf.cpp +++ b/src/snprintf.cpp @@ -775,6 +775,7 @@ static int xdopr(char *buffer, size_t maxlen, const char *format, va_list args) size_t ret; // preconditions + assert(maxlen < INT_MAX); if (buffer != NULL) assert((int)maxlen > 0); else