]> granicus.if.org Git - php/commitdiff
Use sprintf everywhere and define sprintf to php_sprintf, if sprintf is broken.
authorSascha Schumann <sas@php.net>
Sun, 12 Mar 2000 17:18:21 +0000 (17:18 +0000)
committerSascha Schumann <sas@php.net>
Sun, 12 Mar 2000 17:18:21 +0000 (17:18 +0000)
ext/odbc/php_odbc.c
ext/standard/math.c
main/php.h
main/snprintf.h
sapi/cgi/cgi_main.c

index e9ee39a35e4966b492c7421b1db02cd7c5437060..03e154b7c979796dd7c80e4ab1cf78cee6fda2e6 100644 (file)
@@ -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
index 19b87e733c1e980e0d8b6a8a432b0292a12ba1cb..b5ecf38fd923c141855d9daa8d141be1d6f0815a 100644 (file)
@@ -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;
index be87eb1a5ec2b917f1ada3c78b75522a7a3a7926..8cd8f02088bbd80479a9f26fd5b4389faae03545 100644 (file)
@@ -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
 
index 7392416f36bdae8a68bff6856a00f725398e46c4..2eb0eb209957758f0ccb2346e04da5c6e6a164ae 100644 (file)
@@ -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 */
index 6d7aa8eb7d026173677e447dcec3519645b687b2..09379d12bafb6a27622d0caa16b28d4fbcef2cdd 100644 (file)
@@ -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);
        }