]> 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, 20 Sep 2017 12:18:43 +0000 (14:18 +0200)
Reported-by: Laszlo Varkonyi <vlsoftsystems@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index 6ddc48cbbac656ad7c3c14c5f00432779f7aa7a8..b15bc759e9cf0af58ebb39a95438f5d688be193e 100644 (file)
@@ -862,7 +862,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;