Re: cvs: php-src(PHP_5_1) /ext/wddx php_wddx_api.h wddx.c
| From: | Jani Taskinen | Date: | Thu, 06 Oct 2005 12:01:32 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_1) /ext/wddx php_wddx_api.h wddx.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-34349@lists.php.net to get a copy of this message | ||
On Thu, 6 Oct 2005, Rob Richards wrote:
Jani Taskinen wrote:You implying I cant count to 17? I do have toes you know :)@@ -422,7 +422,7 @@ tmp = *var; zval_copy_ctor(&tmp); convert_to_string(&tmp); - snprintf(tmp_buf, Z_STRLEN(tmp), WDDX_NUMBER, Z_STRVAL(tmp)); + snprintf(tmp_buf, Z_STRLEN(tmp) + WDDX_NUMBER_LEN + 1, WDDX_NUMBER, Z_STRVAL(tmp)); zval_dtor(&tmp);Why not like this: snprintf(tmp_buf, Z_STRLEN(tmp) + sizeof(WDDX_NUMBER) + 1, WDDX_NUMBER, Z_STRVAL(tmp)); Adding extra define just for this seems a bit overkill. (and it is error prone too :)
Yeah, but you might not have all of them, how could I know? :)
Wasn't sure if it was looking for max number to write or maximum possible size there so err'd on side of caution. If max possible size, then what about just WDDX_BUF_LEN? (though not to be used in other spot).
I don't feel that strong about this..just anticipated what Andi will say when
he sees this patch. :)
--Jani