aboutsummaryrefslogtreecommitdiffstats
path: root/sys-utils
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2025-10-07 11:57:06 +0200
committerKarel Zak <kzak@redhat.com>2025-10-07 11:57:06 +0200
commit33d3d53139ffd43604ce598625ef87f5bcc58e57 (patch)
tree843fdd0341879bdba8c0f57fc20e2469170b62df /sys-utils
parentc1d4ee34b1f6d5356f1f601231ebaecc5a575202 (diff)
downloadutil-linux-33d3d53139ffd43604ce598625ef87f5bcc58e57.tar.gz
dmesg: use snprintf() instead of sprintf()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/dmesg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 6584613c77..f4b0484002 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -1273,7 +1273,7 @@ full_output:
} else {
char cidbuf[PID_CHARS_MAX+3] = {'\0'};
- sprintf(cidbuf, "[%*s] ",
+ snprintf(cidbuf, sizeof(cidbuf), "[%*s] ",
(char)ctl->caller_id_size, rec->caller_id);
ctl->indent += strnlen(cidbuf, sizeof(cidbuf));
fputs(cidbuf, stdout);