From: Rasmus Lerdorf Date: Wed, 25 Apr 2001 21:05:59 +0000 (+0000) Subject: - Make the printf functions binary clean X-Git-Tag: php-4.0.6RC1~313 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8e682886314e90c438b62bb9c05aac9b60c9d31;p=php - Make the printf functions binary clean @ - Make the printf family of functions binary clean --- diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 2962147e9a..ec89a0b2c0 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -184,7 +184,7 @@ php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add, } } PRINTF_DEBUG(("sprintf: appending \"%s\"\n", add)); - strncpy(&(*buffer)[*pos], add, MIN(max_width, len)+1); + memcpy(&(*buffer)[*pos], add, MIN(max_width, len)+1); *pos += MIN(max_width, len); if (alignment == ALIGN_LEFT) { while (npad--) { @@ -411,7 +411,7 @@ php_formatted_print(int ht, int *len) currarg = 1; - while (format[inpos]) { + while (inpos<(*args[0])->value.str.len) { int expprec = 0; PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos]));