From 5b2a65222065bfc56a938f658501018bc4a8bc82 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 24 Aug 2009 15:41:21 +0300 Subject: ubinize: fix 64-bit image sequence number confusion UBI image sequence number which we store in EC headers is 32 bits, not 64-bits. I was confused when noticed that the 'image_seq' variable had type 'unsigned long long'. Turn it into a 'uint32_t' type. Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubinize.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ubi-utils/src/ubinize.c b/ubi-utils/src/ubinize.c index 2d86c03..dd8d3ed 100644 --- a/ubi-utils/src/ubinize.c +++ b/ubi-utils/src/ubinize.c @@ -70,7 +70,7 @@ static const char *optionsstr = " (default is 0)\n" "-x, --ubi-ver= UBI version number to put to EC headers\n" " (default is 1)\n" -"-Q, --image-seq= 64-bit UBI image sequence number to use\n" +"-Q, --image-seq= 32-bit UBI image sequence number to use\n" " (by default a random number is picked)\n" "-v, --verbose be verbose\n" "-h, --help print help message\n" @@ -143,7 +143,7 @@ struct args { int vid_hdr_offs; int ec; int ubi_ver; - long long image_seq; + uint32_t image_seq; int verbose; dictionary *dict; }; @@ -161,6 +161,7 @@ static int parse_opt(int argc, char * const argv[]) while (1) { int key; char *endp; + unsigned long long image_seq; key = getopt_long(argc, argv, "o:p:m:s:O:e:x:Q:vhV", long_options, NULL); if (key == -1) @@ -216,9 +217,10 @@ static int parse_opt(int argc, char * const argv[]) break; case 'Q': - args.image_seq = strtoul(optarg, &endp, 0); - if (*endp != '\0' || endp == optarg || args.image_seq > 0xFFFFFFFF) + image_seq = strtoul(optarg, &endp, 0); + if (*endp != '\0' || endp == optarg || image_seq > 0xFFFFFFFF) return errmsg("bad UBI image sequence number: \"%s\"", optarg); + args.image_seq = image_seq; break; case 'v': -- cgit v1.2.3