From 4d91ded71d78c5c651482f0e4ae082b73edba0c1 Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Fri, 31 Dec 2010 11:16:06 +0800 Subject: mkfs.jffs2: fix devtable count as mkfs.ubifs does The counting was incorrect. Follow that of mkfs.ubifs. Signed-off-by: Thomas Chou Signed-off-by: Artem Bityutskiy --- mkfs.jffs2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c index 256eec4..167af1f 100644 --- a/mkfs.jffs2.c +++ b/mkfs.jffs2.c @@ -497,10 +497,10 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line) unsigned long i; char *dname, *hpath; - for (i = start; i < count; i++) { + for (i = start; i < (start + count); i++) { xasprintf(&dname, "%s%lu", name, i); xasprintf(&hpath, "%s/%s%lu", rootdir, name, i); - rdev = makedev(major, minor + (i * increment - start)); + rdev = makedev(major, minor + (i - start) * increment); add_host_filesystem_entry(dname, hpath, uid, gid, mode, rdev, parent); free(dname); -- cgit v1.2.3