Re: cvs: php-src(PHP_5_1) /ext/wddx php_wddx_api.h wddx.c
| From: | Rob Richards | Date: | Thu, 06 Oct 2005 10:53:09 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_1) /ext/wddx php_wddx_api.h wddx.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-34348@lists.php.net to get a copy of this message | ||
Jani Taskinen wrote:
You implying I cant count to 17? I do have toes you 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). Rob@@ -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 :)