diff options
author | Sascha Schumann <sas@php.net> | 2000-03-12 17:18:21 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2000-03-12 17:18:21 +0000 |
commit | bb09ee9505023838079d427d47e7d0b0494d1b8c (patch) | |
tree | 630e0c0a4cb16196323e88c1f4759cea3cd60574 | |
parent | 00c14f7413e7dff82fb187d990d5d19c0ad2a7cf (diff) | |
download | php-git-bb09ee9505023838079d427d47e7d0b0494d1b8c.tar.gz |
Use sprintf everywhere and define sprintf to php_sprintf, if sprintf is broken.
-rw-r--r-- | ext/odbc/php_odbc.c | 2 | ||||
-rw-r--r-- | ext/standard/math.c | 2 | ||||
-rw-r--r-- | main/php.h | 2 | ||||
-rw-r--r-- | main/snprintf.h | 3 | ||||
-rw-r--r-- | sapi/cgi/cgi_main.c | 2 |
5 files changed, 5 insertions, 6 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index e9ee39a35e..03e154b7c9 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1725,7 +1725,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) RETURN_FALSE; } - hashed_len = php_sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); + hashed_len = sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); /* FIXME the idea of checking to see if our connection is already persistent is good, but it adds a lot of overhead to non-persistent connections. We diff --git a/ext/standard/math.c b/ext/standard/math.c index 19b87e733c..b5ecf38fd9 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -613,7 +613,7 @@ char *_php_math_number_format(double d,int dec,char dec_point,char thousand_sep) dec = MAX(0,dec); tmpbuf = (char *) emalloc(32+dec); - tmplen=php_sprintf(tmpbuf,"%.*f",dec,d); + tmplen=sprintf(tmpbuf,"%.*f",dec,d); if (!isdigit((int)tmpbuf[0])) { return tmpbuf; diff --git a/main/php.h b/main/php.h index be87eb1a5e..8cd8f02088 100644 --- a/main/php.h +++ b/main/php.h @@ -188,7 +188,7 @@ extern char *strerror(int); #define LONG_MIN (- LONG_MAX - 1) #endif -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || defined(BROKEN_SPRINTF) #include "snprintf.h" #endif diff --git a/main/snprintf.h b/main/snprintf.h index 7392416f36..2eb0eb2099 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -31,8 +31,7 @@ extern int ap_php_vsnprintf(char *, size_t, const char *, va_list ap); #if BROKEN_SPRINTF int php_sprintf (char* s, const char* format, ...); -#else -#define php_sprintf sprintf +#define sprintf php_sprintf #endif #endif /* _PHP_SNPRINTF_H */ diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 6d7aa8eb7d..09379d12ba 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -146,7 +146,7 @@ static void sapi_cgi_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS pi = NULL; } val = emalloc(l + 1); - php_sprintf(val, "%s%s", (sn ? sn : ""), (pi ? pi : "")); /* SAFE */ + sprintf(val, "%s%s", (sn ? sn : ""), (pi ? pi : "")); /* SAFE */ php_register_variable("PHP_SELF", val, track_vars_array ELS_CC PLS_CC); efree(val); } |