diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-12-05 00:19:30 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-12-05 00:36:31 -0800 |
commit | 96508e1b9da790d4b824a42246d1e86379101733 (patch) | |
tree | 280bca1a568083fbe996dc432b0498159b5ab648 | |
parent | 0b780f8cc8bc2606fc3173628c4d3065aae190f8 (diff) |
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 <alan.coopersmith@oracle.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/Error.c | 18 |
2 files changed, 2 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index ae3db02..c75e832 100644 --- a/configure.ac +++ b/configure.ac @@ -70,8 +70,6 @@ case $host_os in [Define to 1 if you have the "poll" function.])) ;; esac -AC_CHECK_FUNC(snprintf, AC_DEFINE(USE_SNPRINTF,1, - [Define to 1 if you have the "snprintf" function.])) AC_HAVE_LIBRARY(ws2_32) 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 { |