From: Karel Zak Date: Wed, 16 Aug 2017 12:15:56 +0000 (+0200) Subject: dmesg: fix delimiter calculation X-Git-Tag: v2.30.2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9ccf6fe72193f508e2a1f44ecfd369e0689bd84;p=thirdparty%2Futil-linux.git dmesg: fix delimiter calculation Reported-by: Laszlo Varkonyi Signed-off-by: Karel Zak --- diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 6ddc48cbba..b15bc759e9 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -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;