Browse files

Handle 64-bit values for offset and length from CLI

  • Loading branch information...
1 parent b9fb6b7 commit ca2dbda0a35ba686c0ed64e109748129c510fa90 @ecashin ecashin committed May 20, 2014
Showing with 7 additions and 2 deletions.
  1. +7 −2 aoe.c
View
9 aoe.c
@@ -463,6 +463,7 @@ main(int argc, char **argv)
{
int ch, omode = 0, readonly = 0;
vlong length = 0;
+ char *end;
bufcnt = Bufcount;
offset = 0;
@@ -488,10 +489,14 @@ main(int argc, char **argv)
setmask(optarg);
break;
case 'o':
- offset = atoi(optarg);
+ offset = strtoll(optarg, &end, 0);
+ if (end == optarg || offset < 0)
+ usage();
break;
case 'l':
- length = atoi(optarg);
+ length = strtoll(optarg, &end, 0);
+ if (end == optarg || length < 1)
+ usage();
break;
case '?':
default:

0 comments on commit ca2dbda

Please sign in to comment.