]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: fix delimiter calculation
authorKarel Zak <kzak@redhat.com>
Wed, 16 Aug 2017 12:15:56 +0000 (14:15 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Aug 2017 12:15:56 +0000 (14:15 +0200)
Reported-by: Laszlo Varkonyi <vlsoftsystems@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index 36d238f0192c7deefaef7c9d1a8827a709a96a2f..b626380f7e96c57522df2bfa1da63c6c58656c69 100644 (file)
@@ -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;