summaryrefslogtreecommitdiffstats
path: root/sys-utils/dmesg.c
diff options
context:
space:
mode:
authorKarel Zak2017-08-16 14:15:56 +0200
committerKarel Zak2017-08-16 14:15:56 +0200
commitfcd90d9ac70c34c21386e6c08a38afdbabb6d00e (patch)
tree0d3a1952a2d0197564559440d365fb4166c82bf2 /sys-utils/dmesg.c
parentlibblkid: fix compiler warning [-Wformat-truncation=] (diff)
downloadkernel-qcow2-util-linux-fcd90d9ac70c34c21386e6c08a38afdbabb6d00e.tar.gz
kernel-qcow2-util-linux-fcd90d9ac70c34c21386e6c08a38afdbabb6d00e.tar.xz
kernel-qcow2-util-linux-fcd90d9ac70c34c21386e6c08a38afdbabb6d00e.zip
dmesg: fix delimiter calculation
Reported-by: Laszlo Varkonyi <vlsoftsystems@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/dmesg.c')
-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 36d238f01..b626380f7 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -873,7 +873,7 @@ static const char *get_subsys_delimiter(const char *mesg, size_t mesg_size)
const char *d = strnchr(p, sz, ':');
if (!d)
return NULL;
- sz -= d - p;
+ sz -= d - p + 1;
if (sz) {
if (isblank(*(d + 1)))
return d;