Re: [PHP4BETA] cvs: /php4/ext/session mod_files.c /php4/ext/standard string.c
| From: | Thies C. Arntzen | Date: | Sun, 19 Dec 1999 13:26:46 +0000 |
| Subject: | Re: [PHP4BETA] cvs: /php4/ext/session mod_files.c /php4/ext/standard string.c | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-8164@lists.php.net to get a copy of this message | ||
shouldn'd we simply #define sprintf to zend_sprintf if the OSs sprintf
does not return the length? - so it's time for mr. autoconf!
i think that would be a better approach (same applies to 3.0).
regards,
tc
On Sun, 19 Dec 1999, Sascha Schumann wrote:
> sas Sat Dec 18 21:13:02 1999 EDT
>
> Modified files:
> /php4/ext/session mod_files.c
> /php4/ext/standard string.c
> Log:
> Use workaround function for sprintf, if the return value of sprintf is needed
>
>
> Index: php4/ext/session/mod_files.c
> diff -u php4/ext/session/mod_files.c:1.21 php4/ext/session/mod_files.c:1.22
> --- php4/ext/session/mod_files.c:1.21 Mon Dec 13 10:55:49 1999
> +++ php4/ext/session/mod_files.c Sat Dec 18 21:12:31 1999
> @@ -100,7 +100,7 @@
> (strlen(data->basedir) + 2 * data->dirdepth + keylen + 5 + sizeof(FILE_PREFIX)))
> return NULL;
> p = key;
> - n = sprintf(buf, "%s/", data->basedir);
> + n = zend_sprintf(buf, "%s/", data->basedir);
> for(i = 0; i < data->dirdepth; i++) {
> buf[n++] = *p++;
> buf[n++] = DIR_DELIMITER;
> Index: php4/ext/standard/string.c
> diff -u php4/ext/standard/string.c:1.76 php4/ext/standard/string.c:1.77
> --- php4/ext/standard/string.c:1.76 Sat Dec 18 17:35:28 1999
> +++ php4/ext/standard/string.c Sat Dec 18 21:12:31 1999
> @@ -18,7 +18,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: string.c,v 1.76 1999/12/18 22:35:28 zeev Exp $ */
> +/* $Id: string.c,v 1.77 1999/12/19 02:12:31 sas Exp $ */
>
> /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
>
> @@ -1607,7 +1607,7 @@
> case '\v': *target++ = 'v'; break;
> case '\b': *target++ = 'b'; break;
> case '\f': *target++ = 'f'; break;
> - default: target += sprintf(target, "%03o", (unsigned char)c);
> + default: target += zend_sprintf(target, "%03o", (unsigned char)c);
> }
> continue;
> }
>
>
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany