From: Karel Zak Date: Wed, 16 Aug 2017 12:15:56 +0000 (+0200) Subject: dmesg: fix delimiter calculation X-Git-Tag: v2.31-rc1~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcd90d9ac70c34c21386e6c08a38afdbabb6d00e;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 36d238f019..b626380f7e 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;