]> git.kaiwu.me - nginx.git/commitdiff
Format specifier fixes in error logging
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 22 Jul 2026 16:11:50 +0000 (20:11 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Fri, 24 Jul 2026 20:50:53 +0000 (00:50 +0400)
Co-authored-by: Nishat Shabbir <nishat@bugqore.com>
src/core/ngx_conf_file.c
src/event/ngx_event_openssl.c
src/event/quic/ngx_event_quic_frames.c
src/http/modules/ngx_http_geo_module.c
src/http/ngx_http_core_module.c
src/http/v2/ngx_http_v2_module.c
src/stream/ngx_stream_geo_module.c

index 197704b0f94e4b8cd256b08c0fb933174ee5d1d3..6ac0d88296d40b47927e753aefac8fa96b573576 100644 (file)
@@ -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;
                 }
 
index c6f9538c9b3449f1d5d74aee555919f9a3f84329..1f3cbb2bd27ade4947da6711b1c7b51c27080f71 100644 (file)
@@ -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;
     }
 
index 888e8bda289b27df4691b2fdb1c8c4127c7bf099..0cd803b0251707d3e16c167fa080808a160bf01d 100644 (file)
@@ -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;
index 5018e1abb572b7e636c42b368dea1b491357a49f..1350c7db49f1d2e35e81851090d0199b05af1abd 100644 (file)
@@ -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);
index b4327c7bc0eab33c0765dc1f0dcd4bb3b4ee6f18..fb4b227ac7c4f2816bf340e5f19868a24f7cbd1a 100644 (file)
@@ -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;
     }
index d64488c20b1ffabe7291d2ed8ee13188f31b195f..4f35705d4698d93e34cceb3dc005d841522c9d35 100644 (file)
@@ -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;
index 316de92869d82c3a831548f2de923b34a46569ee..6dcc3b5a8a674253d5427a4c6e215ac5202adaa0 100644 (file)
@@ -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);