mdev: fix wrong sizeof
authorJavier Viguera <javier.viguera@digi.com>
Fri, 27 Jan 2012 17:30:20 +0000 (18:30 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 30 Jan 2012 01:15:13 +0000 (02:15 +0100)
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/mdev.c

index e5f0c2deb47e81ac8e2d0e3ea7ed79a5a99a24a7..976568814f53ea9828d41939526eb4eb3cdd01af 100644 (file)
@@ -783,7 +783,7 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
                                int seqlen;
                                char seqbuf[sizeof(int)*3 + 2];
 
-                               seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf-1));
+                               seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf) - 1);
                                if (seqlen < 0) {
                                        seq = NULL;
                                        break;