summaryrefslogtreecommitdiffstats
path: root/package/openwrt/trx.c
diff options
context:
space:
mode:
authormbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-03-03 02:44:10 +0000
committermbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-03-03 02:44:10 +0000
commit2b0be6bb82f0402e50c11bb72b41bd4ec9589a66 (patch)
treeeffa4303a465585ece60f334611d03d7157c5783 /package/openwrt/trx.c
parentd52e13dae4779181de437b96df1af57cb49f7fc9 (diff)
target/jffs2/blocksize.mk for setting block size (req. for wrt54g)
squashfs removed in favor of squashfs-lzma git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@301 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/openwrt/trx.c')
-rw-r--r--package/openwrt/trx.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/package/openwrt/trx.c b/package/openwrt/trx.c
index d4ad60037..79a04026e 100644
--- a/package/openwrt/trx.c
+++ b/package/openwrt/trx.c
@@ -170,7 +170,12 @@ int main(int argc, char **argv)
}
break;
case 'a':
- n = atoi(optarg);
+ errno = 0;
+ n = strtoul(optarg, &e, 0);
+ if (errno || (e == optarg) || *e) {
+ fprintf(stderr, "illegal numeric string\n");
+ usage();
+ }
if (cur_len & (n-1)) {
n = n - (cur_len & (n-1));
memset(buf + cur_len, 0, n);
@@ -178,7 +183,12 @@ int main(int argc, char **argv)
}
break;
case 'b':
- n = atoi(optarg);
+ errno = 0;
+ n = strtoul(optarg, &e, 0);
+ if (errno || (e == optarg) || *e) {
+ fprintf(stderr, "illegal numeric string\n");
+ usage();
+ }
if (n < cur_len) {
fprintf(stderr, "WARNING: current length exceeds -b %d offset\n",n);
} else {