[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] [PATCH] dmsetup: fix sscanf return check



---
 tools/dmsetup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 0ac970f..65d17f8 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -228,8 +228,7 @@ static int _parse_line(struct dm_task *dmt, char *buffer, const char *file,
 	if (!*ptr || *ptr == '#')
 		return 1;
 
-	if (sscanf(ptr, "%llu %llu %s %n",
-		   &start, &size, ttype, &n) < 3) {
+	if (sscanf(ptr, "%llu %llu %s %n", &start, &size, ttype, &n) != 4) {
 		err("Invalid format on line %d of table %s", line, file);
 		return 0;
 	}
-- 
1.7.11.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]