Skip to content

Commit

Permalink
mxqsub: Use mx_strtobytes() to parse --memory option
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Aug 26, 2015
1 parent b92053b commit e9222d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mxqsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,13 @@ int main(int argc, char *argv[])

case 'm':
if (mx_strtou64(optctl.optarg, &arg_memory) < 0) {
mx_log_crit("--memory '%s': %m", optctl.optarg);
exit(EX_CONFIG);
unsigned long long int bytes;

if(mx_strtobytes(optctl.optarg, &bytes) < 0) {
mx_log_crit("--memory '%s': %m", optctl.optarg);
exit(EX_CONFIG);
}
arg_memory = bytes/1024/1024;
}
break;

Expand Down

0 comments on commit e9222d8

Please sign in to comment.