aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-23 12:10:39 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-23 12:10:39 -0400
commit5f2ea37030f7c163764733d42738bcd05bc8258a (patch)
tree96a5aaaadb779a95237de51e4a708432e34e2367
parent7aa05b4c4db5bca53f9ed957e4307235be844e9b (diff)
downloadstasis-5f2ea37030f7c163764733d42738bcd05bc8258a.tar.gz
Fix snprintf maxlen
-rw-r--r--src/lib/core/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/core/utils.c b/src/lib/core/utils.c
index 21f2297..2b7f0ec 100644
--- a/src/lib/core/utils.c
+++ b/src/lib/core/utils.c
@@ -925,9 +925,7 @@ void debug_hexdump(char *data, int len) {
char *pos = start;
while (pos != end) {
if (count == 0) {
- const char *pos_fmt = "%p";
- const int pos_fmt_len = snprintf(NULL, 0, pos_fmt, pos);
- snprintf(addr + strlen(addr), sizeof(addr) - strlen(addr) - pos_fmt_len, pos_fmt, pos);
+ snprintf(addr + strlen(addr), sizeof(addr) - strlen(addr), "%p", pos);
}
if (count == 8) {
strncat(bytes, " ", sizeof(bytes) - strlen(bytes) - 1);