From e9d8b438af3272b4b92b5414e6835b44ee255f0f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 6 May 2010 15:29:20 +0200 Subject: [PATCH] libblkid: fix readline usage Signed-off-by: Karel Zak --- shlibs/blkid/src/devno.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'; -- 2.39.5