summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2010-11-29 00:01:58 -0800
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-12-02 05:25:42 +0200
commit59b4ceaa65902ff2dcf13d12fb4ef97ea3ad8cec (patch)
tree499171d50fd7a22d23630cc1644009a9729abc85
parent5a4d06c0fc94cf48d5bab3afa97b16c9022c4181 (diff)
nanddump: change "unsigned" to "signed"
For consistency between nanddump and nandwrite and in order to provide better means for checking for negative inputs, the "offset" and "length" types in nanddump should be changed to signed integer types. This also solves a signed/unsigned comparison warning. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--nanddump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/nanddump.c b/nanddump.c
index 14a8816..b0dd7dc 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -82,8 +82,8 @@ static bool pretty_print = false; // print nice
static bool noecc = false; // don't error correct
static bool noskipbad = false; // don't skip bad blocks
static bool omitoob = false; // omit oob data
-static unsigned long long start_addr; // start address
-static unsigned long long length; // dump length
+static long long start_addr; // start address
+static long long length; // dump length
static const char *mtddev; // mtd device name
static const char *dumpfile; // dump file name
static bool omitbad = false;
@@ -136,7 +136,7 @@ static void process_options(int argc, char * const argv[])
omitbad = true;
break;
case 's':
- start_addr = simple_strtoull(optarg, &error);
+ start_addr = simple_strtoll(optarg, &error);
break;
case 'f':
if (!(dumpfile = strdup(optarg))) {
@@ -145,7 +145,7 @@ static void process_options(int argc, char * const argv[])
}
break;
case 'l':
- length = simple_strtoull(optarg, &error);
+ length = simple_strtoll(optarg, &error);
break;
case 'o':
omitoob = true;
@@ -273,8 +273,8 @@ nil:
*/
int main(int argc, char * const argv[])
{
- unsigned long long ofs, end_addr = 0;
- unsigned long long blockstart = 1;
+ long long ofs, end_addr = 0;
+ long long blockstart = 1;
int ret, i, fd, ofd = 0, bs, badblock = 0;
struct mtd_dev_info mtd;
char pretty_buf[PRETTY_BUF_LEN];