Skip to content

Commit

Permalink
Fixed format specifiers in ngx_sprintf().
Browse files Browse the repository at this point in the history
  • Loading branch information
pluknet committed Mar 30, 2016
1 parent 00ef9ff commit 6a716c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/ngx_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ ngx_inet6_ntop(u_char *p, u_char *text, size_t len)
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++ = ':';
Expand Down
4 changes: 2 additions & 2 deletions src/core/ngx_times.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 6a716c6

Please sign in to comment.