Browse Source

- Make the printf functions binary clean

@ - Make the printf family of functions binary clean
PHP-4.0.6
Rasmus Lerdorf 25 years ago
parent
commit
e8e6828863
  1. 4
      ext/standard/formatted_print.c

4
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]));

Loading…
Cancel
Save