diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2007-02-24 16:23:10 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2007-02-24 16:23:10 +0000 |
commit | f4a8180f653faeb57dc373b667f34d3f2bdc37c2 (patch) | |
tree | 09ae0312d290e7276211a6fc76eb83388a047312 /ext/zip/lib | |
parent | a2a55daf213a1ad0925914abe55013be796dd35c (diff) | |
download | php-git-f4a8180f653faeb57dc373b667f34d3f2bdc37c2.tar.gz |
Fixed snprintf() usage
Diffstat (limited to 'ext/zip/lib')
-rw-r--r-- | ext/zip/lib/zip_close.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c index a5a1bc094d..e701321a81 100644 --- a/ext/zip/lib/zip_close.c +++ b/ext/zip/lib/zip_close.c @@ -527,13 +527,14 @@ _zip_create_temp_output(struct zip *za, FILE **outp) char *temp; int tfd; FILE *tfp; + int len = strlen(za->zn) + 8; - if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) { + if ((temp=(char *)malloc(len)) == NULL) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } - snprintf(temp, sizeof(temp), "%s.XXXXXX", za->zn); + snprintf(temp, len, "%s.XXXXXX", za->zn); if ((tfd=mkstemp(temp)) == -1) { _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno); |