Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed format specifiers in ngx_sprintf().

Sergey Kandaurov
March 30, 2016 08:16PM
details: http://hg.nginx.org/nginx/rev/40bea39731d7
branches:
changeset: 6481:40bea39731d7
user: Sergey Kandaurov <pluknet@nginx.com>
date: Thu Mar 31 02:34:00 2016 +0300
description:
Fixed format specifiers in ngx_sprintf().

diffstat:

src/core/ngx_inet.c | 2 +-
src/core/ngx_times.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r f01ab2dbcfdc -r 40bea39731d7 src/core/ngx_inet.c
--- a/src/core/ngx_inet.c Thu Mar 31 02:33:57 2016 +0300
+++ b/src/core/ngx_inet.c Thu Mar 31 02:34:00 2016 +0300
@@ -348,7 +348,7 @@ ngx_inet6_ntop(u_char *p, u_char *text,
continue;
}

- dst = ngx_sprintf(dst, "%uxi", p[i] * 256 + p[i + 1]);
+ dst = ngx_sprintf(dst, "%uxd", p[i] * 256 + p[i + 1]);

if (i < 14) {
*dst++ = ':';
diff -r f01ab2dbcfdc -r 40bea39731d7 src/core/ngx_times.c
--- a/src/core/ngx_times.c Thu Mar 31 02:33:57 2016 +0300
+++ b/src/core/ngx_times.c Thu Mar 31 02:34:00 2016 +0300
@@ -154,7 +154,7 @@ ngx_time_update(void)

p2 = &cached_http_log_time[slot][0];

- (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d",
+ (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02i%02i",
tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],
tm.ngx_tm_year, tm.ngx_tm_hour,
tm.ngx_tm_min, tm.ngx_tm_sec,
@@ -163,7 +163,7 @@ ngx_time_update(void)

p3 = &cached_http_log_iso8601[slot][0];

- (void) ngx_sprintf(p3, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
+ (void) ngx_sprintf(p3, "%4d-%02d-%02dT%02d:%02d:%02d%c%02i:%02i",
tm.ngx_tm_year, tm.ngx_tm_mon,
tm.ngx_tm_mday, tm.ngx_tm_hour,
tm.ngx_tm_min, tm.ngx_tm_sec,

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed format specifiers in ngx_sprintf().

Sergey Kandaurov 353 March 30, 2016 08:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 227
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready