diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-05-01 18:53:04 +0000 |
---|---|---|
committer | Jonathan Kolb <jon@b0g.us> | 2009-05-01 18:53:04 +0000 |
commit | 1a537756bb9d3018ea6ab099b22e9734cc8a879d (patch) | |
tree | 6d2fe235b46b0de3053db6c84739db4f34e674e7 /src/core/ngx_string.c | |
parent | b04081c3ce5d031367a0142d57e287e26ba2e415 (diff) | |
download | nginx-0.7.54.tar.gz |
Changes with nginx 0.7.54 01 May 2009v0.7.54
*) Feature: the ngx_http_image_filter_module.
*) Feature: the "proxy_ignore_headers" and "fastcgi_ignore_headers"
directives.
*) Bugfix: a segmentation fault might occur in worker process, if an
"open_file_cache_errors off" directive was used; the bug had
appeared in 0.7.53.
*) Bugfix: the "port_in_redirect off" directive did not work; the bug
had appeared in 0.7.39.
*) Bugfix: improve handling of "select" method errors.
*) Bugfix: of "select() failed (10022: ...)" error in nginx/Windows.
*) Bugfix: in error text descriptions in nginx/Windows; the bug had
appeared in 0.7.53.
Diffstat (limited to 'src/core/ngx_string.c')
-rw-r--r-- | src/core/ngx_string.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index 9b63891a8..d73cb8699 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -99,7 +99,7 @@ ngx_sprintf(u_char *buf, const char *fmt, ...) va_list args; va_start(args, fmt); - p = ngx_vsnprintf(buf, /* STUB */ 65536, fmt, args); + p = ngx_vslprintf(buf, (void *) -1, fmt, args); va_end(args); return p; @@ -113,7 +113,21 @@ ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...) va_list args; va_start(args, fmt); - p = ngx_vsnprintf(buf, max, fmt, args); + p = ngx_vslprintf(buf, buf + max, fmt, args); + va_end(args); + + return p; +} + + +u_char * ngx_cdecl +ngx_slprintf(u_char *buf, u_char *last, const char *fmt, ...) +{ + u_char *p; + va_list args; + + va_start(args, fmt); + p = ngx_vslprintf(buf, last, fmt, args); va_end(args); return p; @@ -121,9 +135,9 @@ ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...) u_char * -ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) +ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) { - u_char *p, zero, *last; + u_char *p, zero; int d; float f, scale; size_t len, slen; @@ -134,12 +148,6 @@ ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) ngx_str_t *v; ngx_variable_value_t *vv; - if (max == 0) { - return buf; - } - - last = buf + max; - while (*fmt && buf < last) { /* |