From c48ce65e277fab7bd4968dad4cc0471df084d7f4 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 23 Apr 2008 13:48:09 +0300 Subject: mtd-utils: fix input parameter checks Signed-off-by: Artem Bityutskiy --- ubi-utils/new-utils/src/ubinize.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ubi-utils/new-utils/src/ubinize.c') diff --git a/ubi-utils/new-utils/src/ubinize.c b/ubi-utils/new-utils/src/ubinize.c index cd4952d..704d906 100644 --- a/ubi-utils/new-utils/src/ubinize.c +++ b/ubi-utils/new-utils/src/ubinize.c @@ -191,19 +191,19 @@ static int parse_opt(int argc, char * const argv[]) case 'O': args.vid_hdr_offs = strtoul(optarg, &endp, 0); - if (endp == optarg || args.vid_hdr_offs < 0) + if (*endp != '\0' || endp == optarg || args.vid_hdr_offs < 0) return errmsg("bad VID header offset: \"%s\"", optarg); break; case 'e': args.ec = strtoul(optarg, &endp, 0); - if (endp == optarg || args.ec < 0) + if (*endp != '\0' || endp == optarg || args.ec < 0) return errmsg("bad erase counter value: \"%s\"", optarg); break; case 'x': args.ubi_ver = strtoul(optarg, &endp, 0); - if (endp == optarg || args.ubi_ver < 0) + if (*endp != '\0' || endp == optarg || args.ubi_ver < 0) return errmsg("bad UBI version: \"%s\"", optarg); break; -- cgit v1.2.3