Skip to content

Commit

Permalink
Core: fixed format specifier in ngx_realloc().
Browse files Browse the repository at this point in the history
The uintptr_t is an integer type, so the solution is to either update
format specifier or cast the value to pointer.  Attempt to cast results
in compiler warning as described in comment regarding gcc 12 workaround.
  • Loading branch information
vlhomutov committed Dec 28, 2022
1 parent d0e5b61 commit a20e758
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/os/unix/ngx_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ ngx_realloc(void *p, size_t size, ngx_log_t *log)
rp = realloc(p, size);
if (rp == NULL) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
"realloc(%p, %uz) failed", ptr, size);
"realloc(%0uXi, %uz) failed", ptr, size);
}

ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, "realloc: %p:%uz (prev: %p)",
ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, "realloc: %p:%uz (prev: %0uXi)",
rp, size, ptr);

return rp;
Expand Down

0 comments on commit a20e758

Please sign in to comment.