From 96508e1b9da790d4b824a42246d1e86379101733 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 5 Dec 2010 00:19:30 -0800 Subject: Remove non-USE_SNPRINTF case from src/Error.c unifdef -DUSE_SNPRINTF src/Error.c Plus manual removal of old #ifdef notyet section that said not enough platforms had snprintf support yet. Welcome to the new millenium! Signed-off-by: Alan Coopersmith --- src/Error.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/Error.c') diff --git a/src/Error.c b/src/Error.c index 1112ef9..fc9b11a 100644 --- a/src/Error.c +++ b/src/Error.c @@ -233,11 +233,6 @@ static void DefaultMsg ( void (*fn)(_Xconst _XtString)) { #define BIGBUF 1024 -#ifdef notyet /* older versions don't, might want to wait until more do */ -#if defined(__linux__) || defined(CSRG_BASED) /* everyone else needs to get with the program */ -#define USE_SNPRINTF -#endif -#endif char buffer[BIGBUF]; char* message; XtGetErrorDatabaseText(name,type,class,defaultp, buffer, BIGBUF); @@ -302,18 +297,9 @@ program as a non-root user or by removing the suid bit on the executable."); * to be a performance issue. */ if ((message = __XtMalloc (BIGBUF))) { -#ifndef USE_SNPRINTF - message[BIGBUF-1] = 0; - (void) sprintf (message, buffer, -#else (void) snprintf (message, BIGBUF, buffer, -#endif - par[0], par[1], par[2], par[3], par[4], - par[5], par[6], par[7], par[8], par[9]); -#ifndef USE_SNPRINTF - if (message[BIGBUF-1] != '\0') - XtWarning ("Possible heap corruption in Xt{Error,Warning}MsgHandler"); -#endif + par[0], par[1], par[2], par[3], par[4], + par[5], par[6], par[7], par[8], par[9]); (*fn)(message); XtFree(message); } else { -- cgit v1.2.3