diff options
| author | Marcus Boerger <helly@php.net> | 2007-02-24 16:25:58 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2007-02-24 16:25:58 +0000 |
| commit | 20a40063c51b20c1ea5f48c109b69fea3964b446 (patch) | |
| tree | 24d6bf7894cc8080ff86f16eb5efef9da1cdf9c7 /ext/soap/php_encoding.c | |
| parent | 10ffce328593ddda1fb31482ec5d19ce6e02556d (diff) | |
| download | php-git-20a40063c51b20c1ea5f48c109b69fea3964b446.tar.gz | |
- avoid sprintf
Diffstat (limited to 'ext/soap/php_encoding.c')
| -rw-r--r-- | ext/soap/php_encoding.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 133875e80f..c062696468 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -904,7 +904,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode if (Z_TYPE_P(data) == IS_DOUBLE) { char s[256]; - sprintf(s, "%0.0f",floor(Z_DVAL_P(data))); + snprintf(s, sizeof(s), "%0.0f",floor(Z_DVAL_P(data))); xmlNodeSetContent(ret, BAD_CAST(s)); } else { zval tmp = *data; @@ -2660,12 +2660,12 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma /* Time zone support */ #ifdef HAVE_TM_GMTOFF - sprintf(tzbuf, "%c%02d:%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 )); + snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 )); #else # ifdef __CYGWIN__ - sprintf(tzbuf, "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); + snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); # else - sprintf(tzbuf, "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); + snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); # endif #endif if (strcmp(tzbuf,"+00:00") == 0) { |
