From: kd@flaga.is (Kári Davíðsson)
To: mtd@infradead.org
Subject: Small patch
Date: Fri, 9 Mar 2001 16:54:23 +0000 [thread overview]
Message-ID: <20010309165423.A2340@BigTits.flaga> (raw)
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
Hi,
I propose the following small patch so that the utils can acept arguments
int hexadecimal form, e.g.
erase device 0x1f0000
instead of erase device 2031616.
K.D.
[-- Attachment #2: atoi.diff --]
[-- Type: text/plain, Size: 1930 bytes --]
diff -ubr mtd/util/erase.c mtd-20010308/util/erase.c
--- mtd/util/erase.c Thu Sep 21 22:00:07 2000
+++ mtd-20010308/util/erase.c Fri Mar 9 16:38:55 2001
@@ -35,12 +35,12 @@
printf("Erase Unit Size 0x%lx, ", meminfo.erasesize);
if (argc > 2)
- erase.start = atoi(argv[2]);
+ erase.start = strtol(argv[2], NULL, 0);
else
erase.start = 0;
if (argc > 3)
- count = atoi(argv[3]);
+ count = strtol(argv[3], NULL, 0);
else
count = 1;
diff -ubr mtd/util/mkfs.ffs2.c mtd-20010308/util/mkfs.ffs2.c
--- mtd/util/mkfs.ffs2.c Tue Aug 17 19:04:42 1999
+++ mtd-20010308/util/mkfs.ffs2.c Fri Mar 9 16:43:05 2001
@@ -65,11 +65,11 @@
switch (Opt)
{
case 'b':
- BlockSize = atoi(optarg);
+ BlockSize = strtol(optarg, NULL, 0);
break;
case 's':
- Start = atoi(optarg);
+ Start = strtol(optarg,NULL,0);
break;
case '?':
diff -ubr mtd/util/mkfs.jffs.c mtd-20010308/util/mkfs.jffs.c
--- mtd/util/mkfs.jffs.c Wed Jan 17 23:00:03 2001
+++ mtd-20010308/util/mkfs.jffs.c Fri Mar 9 16:44:20 2001
@@ -698,7 +698,7 @@
}
break;
case 'e':
- MAX_CHUNK_SIZE = (atoi(optarg) / 2);
+ MAX_CHUNK_SIZE = (strtol(optarg,NULL,0) / 2);
break;
case 'h':
case '?':
diff -ubr mtd/util/mkfs.jffs2.c mtd-20010308/util/mkfs.jffs2.c
--- mtd/util/mkfs.jffs2.c Mon Feb 26 23:00:06 2001
+++ mtd-20010308/util/mkfs.jffs2.c Fri Mar 9 16:43:52 2001
@@ -430,7 +430,7 @@
while ( (opt = getopt_long(argc, argv, "p:d:r:s:e:o:h?", long_options, &c) ) >= 0) {
switch(opt) {
case 'p':
- pad_fs_size = atoi(optarg);
+ pad_fs_size = strtol(optarg, NULL, 0);
break;
case 'r':
@@ -447,11 +447,11 @@
break;
case 's':
- page_size = atoi(optarg);
+ page_size = strtol(optarg,NULL,0);
break;
case 'e':
- erase_block_size = atoi(optarg);
+ erase_block_size = strtol(optarg,NULL,0);
break;
case 'o':
next reply other threads:[~2001-03-09 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-09 16:54 Kári Davíðsson [this message]
2001-03-09 19:36 ` Small patch Russ Dill
2001-03-11 11:45 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010309165423.A2340@BigTits.flaga \
--to=kd@flaga.is \
--cc=mtd@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox