Skip to content

Commit

Permalink
Update general.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarge authored Aug 8, 2023
1 parent 4221805 commit e93ef21
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/general.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,21 @@ int check_arguments(int argc, char** argv) {

const char* errstr;

if (!is_num(argv[2])) return -2;
if (!is_num(argv[2]))
return -2;

if (
!is_format(argv[1])
) {
strtonum(argv[2], 0, 0, &errstr);
} else {
if (is_format(argv[1])) {
// TODO: should allow the use of unlimited hours?
// for now, it's left to double digit hours
if (strlen(argv[2]) != 6)
return -1;
strtonum(argv[2], 1, 999999, &errstr);
} else {
strtonum(argv[2], 0, 0, &errstr);
}

if (errstr) {
printf("%s\n\n", errstr);
printf("ERROR: STRTONUM; number is %s\n", errstr);
FAULT:
return 1;
}
Expand Down

0 comments on commit e93ef21

Please sign in to comment.