From: Karel Zak Date: Thu, 6 May 2010 13:29:20 +0000 (+0200) Subject: libblkid: fix readline usage X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9d8b438af3272b4b92b5414e6835b44ee255f0f;p=util-linux libblkid: fix readline usage Signed-off-by: Karel Zak --- diff --git a/shlibs/blkid/src/devno.c b/shlibs/blkid/src/devno.c index a667becf..1d389ac6 100644 --- a/shlibs/blkid/src/devno.c +++ b/shlibs/blkid/src/devno.c @@ -364,7 +364,7 @@ int blkid_devno_to_wholedisk(dev_t dev, char *diskname, * - dirname ../../block/sda/sda1 = ../../block/sda * - basename ../../block/sda = sda */ - linklen = readlink(path, linkpath, sizeof(linkpath)); + linklen = readlink(path, linkpath, sizeof(linkpath) - 1); if (linklen < 0) goto err; linkpath[linklen] = '\0';