]> err.no Git - util-linux/commitdiff
libblkid: fix readline usage
authorKarel Zak <kzak@redhat.com>
Thu, 6 May 2010 13:29:20 +0000 (15:29 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 May 2010 13:29:20 +0000 (15:29 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/devno.c

index a667becf5260c5bfb0014ee6bed4561f83cbc3de..1d389ac6951da7a0696f48ed36bde5452feb37ba 100644 (file)
@@ -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';