# HG changeset patch # User Igor Sysoev # Date 1201014781 0 # Node ID 8382d94ba6aed5b494922c84cefb460730b2b698 # Parent 04b04e6d60f426e36504e31a471e28fb86a87f9d allow zero length in %*s diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -147,7 +147,7 @@ ngx_vsnprintf(u_char *buf, size_t max, c sign = 1; hexadecimal = 0; max_width = 0; - slen = 0; + slen = (size_t) -1; p = temp + NGX_INT64_LEN; @@ -221,7 +221,7 @@ ngx_vsnprintf(u_char *buf, size_t max, c case 's': p = va_arg(args, u_char *); - if (slen == 0) { + if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; }