diff options
| author | Marcus Boerger <helly@php.net> | 2007-02-24 02:17:47 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2007-02-24 02:17:47 +0000 |
| commit | 50ea26760da4e0fcf4980e739e1d0ed520de8d59 (patch) | |
| tree | 888a32ce58864f5318a7f1072f8526c6a99212f9 /ext/date/php_date.c | |
| parent | 3e262bd36989898ac01224f0a987e79f44d25b31 (diff) | |
| download | php-git-50ea26760da4e0fcf4980e739e1d0ed520de8d59.tar.gz | |
- Avoid sprintf, even when checked copy'n'paste or changes lead to errors
Diffstat (limited to 'ext/date/php_date.c')
| -rw-r--r-- | ext/date/php_date.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 14534b846d..2ea2c42e2e 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2244,7 +2244,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su int rs; timelib_time *t; timelib_tzinfo *tzi; - char retstr[6]; + char *retstr; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) { RETURN_FALSE; @@ -2310,8 +2310,8 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su } switch (retformat) { case SUNFUNCS_RET_STRING: - sprintf(retstr, "%02d:%02d", (int) N, (int) (60 * (N - (int) N))); - RETURN_STRINGL(retstr, 5, 1); + spprintf(&retstr, 0, "%02d:%02d", (int) N, (int) (60 * (N - (int) N))); + RETURN_STRINGL(retstr, 5, 0); break; case SUNFUNCS_RET_DOUBLE: RETURN_DOUBLE(N); |
