diff options
| author | Stanislav Malyshev <stas@php.net> | 2000-08-14 15:54:57 +0000 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2000-08-14 15:54:57 +0000 |
| commit | 159abaa9008643dc5e0df27d48e02be1140c78ee (patch) | |
| tree | 1065a5f759f82875b5cbaa2356880860def737a9 | |
| parent | 821042278eb04b5f0baf50357d3a928debccec3c (diff) | |
| download | php-git-159abaa9008643dc5e0df27d48e02be1140c78ee.tar.gz | |
Fix print length - again
# I hope _this_ is the right fix...
| -rw-r--r-- | ext/standard/formatted_print.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 2846eaaa98..04f7811c92 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, max_width-*pos+1); + strncpy(&(*buffer)[*pos], add, MIN(max_width, len)+1); *pos += MIN(max_width, len); if (alignment == ALIGN_LEFT) { while (npad--) { |
