linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] nanddump/nandwrite: use "simple_" str functions
@ 2010-11-29  8:01 Brian Norris
  2010-11-29  8:01 ` [PATCH 2/8] mtd-utils: common.h: Add MAX() macro, fix MIN() Brian Norris
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Brian Norris @ 2010-11-29  8:01 UTC (permalink / raw)
  To: linux-mtd; +Cc: Brian Norris, David Woodhouse, Mike Frysinger, Artem Bityutskiy

Per Mike Frysinger's suggestion, we check for strtoll() and strtoull()
errors by using the "common.h" helper functions simple_strtoll() and
simple_strtoull().

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 nanddump.c  |    4 ++--
 nandwrite.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/nanddump.c b/nanddump.c
index fe29596..bf95e81 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -136,7 +136,7 @@ static void process_options(int argc, char * const argv[])
 				omitbad = true;
 				break;
 			case 's':
-				start_addr = strtoull(optarg, NULL, 0);
+				start_addr = simple_strtoull(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 = strtoull(optarg, NULL, 0);
+				length = simple_strtoull(optarg, &error);
 				break;
 			case 'o':
 				omitoob = true;
diff --git a/nandwrite.c b/nandwrite.c
index bbe69b0..5373a89 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -201,7 +201,7 @@ static void process_options(int argc, char * const argv[])
 				writeoob = true;
 				break;
 			case 's':
-				mtdoffset = strtoll(optarg, NULL, 0);
+				mtdoffset = simple_strtoll(optarg, &error);
 				break;
 			case 'b':
 				blockalign = atoi(optarg);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-12-02  3:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29  8:01 [PATCH 1/8] nanddump/nandwrite: use "simple_" str functions Brian Norris
2010-11-29  8:01 ` [PATCH 2/8] mtd-utils: common.h: Add MAX() macro, fix MIN() Brian Norris
2010-11-29  8:01 ` [PATCH 3/8] nanddump: Refactor pretty print code into an sprintf() Brian Norris
2010-11-29  8:01 ` [PATCH 4/8] nanddump: change "unsigned" to "signed" Brian Norris
2010-11-29  8:01 ` [PATCH 5/8] nanddump: check for negative inputs Brian Norris
2010-12-01  6:18   ` [PATCH v2 " Brian Norris
2010-12-01  7:12     ` [PATCH v3 " Brian Norris
2010-11-29  8:02 ` [PATCH 6/8] nanddump: choose correct "printf" format-specifier Brian Norris
2010-11-29  8:02 ` [PATCH 7/8] nandwrite: add check for negative blockalign Brian Norris
2010-11-29  8:05   ` Mike Frysinger
2010-12-01  6:11     ` Brian Norris
2010-12-01  6:19   ` [PATCH v2 " Brian Norris
2010-11-29  8:02 ` [PATCH 8/8] nandwrite: use common.h "errmsg_die" Brian Norris
2010-12-01  6:20   ` [PATCH v2 " Brian Norris
2010-12-02  3:27 ` [PATCH 1/8] nanddump/nandwrite: use "simple_" str functions Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).