From: Sergey Kandaurov Date: Wed, 22 Jul 2026 16:11:50 +0000 (+0400) Subject: Format specifier fixes in error logging X-Git-Tag: release-1.31.4~18 X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=33eedb5ae66a4b492749f5747327d0867d5f5d0b;p=nginx.git Format specifier fixes in error logging Co-authored-by: Nishat Shabbir --- diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 197704b0f..6ac0d8829 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -566,7 +566,7 @@ ngx_conf_read_token(ngx_conf_t *cf) } else { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "too long parameter \"%*s...\" started", - 10, start); + (size_t) 10, start); return NGX_ERROR; } diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c index c6f9538c9..1f3cbb2bd 100644 --- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -1730,7 +1730,7 @@ ngx_ssl_ech_files(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_array_t *filenames) if (OSSL_ECHSTORE_num_keys(es, &numkeys) != 1) { ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0, - "OSSL_ECHSTORE_num_keys(%s) failed"); + "OSSL_ECHSTORE_num_keys() failed"); goto cleanup; } diff --git a/src/event/quic/ngx_event_quic_frames.c b/src/event/quic/ngx_event_quic_frames.c index 888e8bda2..0cd803b02 100644 --- a/src/event/quic/ngx_event_quic_frames.c +++ b/src/event/quic/ngx_event_quic_frames.c @@ -694,7 +694,7 @@ ngx_quic_log_frame(ngx_log_t *log, ngx_quic_frame_t *f, ngx_uint_t tx) case NGX_QUIC_FT_ACK: case NGX_QUIC_FT_ACK_ECN: - p = ngx_slprintf(p, last, "ACK n:%ui delay:%uL ", + p = ngx_slprintf(p, last, "ACK n:%uL delay:%uL ", f->u.ack.range_count, f->u.ack.delay); if (f->data) { @@ -758,7 +758,7 @@ ngx_quic_log_frame(ngx_log_t *log, ngx_quic_frame_t *f, ngx_uint_t tx) case NGX_QUIC_FT_CONNECTION_CLOSE: case NGX_QUIC_FT_CONNECTION_CLOSE_APP: - p = ngx_slprintf(p, last, "CONNECTION_CLOSE%s err:%ui", + p = ngx_slprintf(p, last, "CONNECTION_CLOSE%s err:%uL", f->type == NGX_QUIC_FT_CONNECTION_CLOSE ? "" : "_APP", f->u.close.error_code); @@ -767,7 +767,7 @@ ngx_quic_log_frame(ngx_log_t *log, ngx_quic_frame_t *f, ngx_uint_t tx) } if (f->type == NGX_QUIC_FT_CONNECTION_CLOSE) { - p = ngx_slprintf(p, last, " ft:%ui", f->u.close.frame_type); + p = ngx_slprintf(p, last, " ft:%uL", f->u.close.frame_type); } break; diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c index 5018e1abb..1350c7db4 100644 --- a/src/http/modules/ngx_http_geo_module.c +++ b/src/http/modules/ngx_http_geo_module.c @@ -964,7 +964,7 @@ ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx, e = (ngx_uint_t) range[i].end; ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "range \"%V\" overlaps \"%d.%d.%d.%d-%d.%d.%d.%d\"", + "range \"%V\" overlaps \"%i.%i.%i.%i-%i.%i.%i.%i\"", ctx->net, h >> 8, h & 0xff, s >> 8, s & 0xff, h >> 8, h & 0xff, e >> 8, e & 0xff); diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index b4327c7bc..fb4b227ac 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -5456,7 +5456,7 @@ ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data) if (*sp % NGX_POOL_ALIGNMENT) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the pool size must be a multiple of %uz", + "the pool size must be a multiple of %d", NGX_POOL_ALIGNMENT); return NGX_CONF_ERROR; } diff --git a/src/http/v2/ngx_http_v2_module.c b/src/http/v2/ngx_http_v2_module.c index d64488c20..4f35705d4 100644 --- a/src/http/v2/ngx_http_v2_module.c +++ b/src/http/v2/ngx_http_v2_module.c @@ -411,7 +411,7 @@ ngx_http_v2_pool_size(ngx_conf_t *cf, void *post, void *data) if (*sp % NGX_POOL_ALIGNMENT) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the pool size must be a multiple of %uz", + "the pool size must be a multiple of %d", NGX_POOL_ALIGNMENT); return NGX_CONF_ERROR; @@ -428,7 +428,7 @@ ngx_http_v2_preread_size(ngx_conf_t *cf, void *post, void *data) if (*sp > NGX_HTTP_V2_MAX_WINDOW) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the maximum body preread buffer size is %uz", + "the maximum body preread buffer size is %ud", NGX_HTTP_V2_MAX_WINDOW); return NGX_CONF_ERROR; diff --git a/src/stream/ngx_stream_geo_module.c b/src/stream/ngx_stream_geo_module.c index 316de9286..6dcc3b5a8 100644 --- a/src/stream/ngx_stream_geo_module.c +++ b/src/stream/ngx_stream_geo_module.c @@ -914,7 +914,7 @@ ngx_stream_geo_add_range(ngx_conf_t *cf, ngx_stream_geo_conf_ctx_t *ctx, e = (ngx_uint_t) range[i].end; ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "range \"%V\" overlaps \"%d.%d.%d.%d-%d.%d.%d.%d\"", + "range \"%V\" overlaps \"%i.%i.%i.%i-%i.%i.%i.%i\"", ctx->net, h >> 8, h & 0xff, s >> 8, s & 0xff, h >> 8, h & 0xff, e >> 8, e & 0xff);