Skip to content

Commit

Permalink
properly init the endptr
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter93 committed May 31, 2023
1 parent 782a083 commit 1976010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sonixflasher.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ int main(int argc, char* argv[])
uint16_t pid = 0;
long offset = 0;
char* file_name = NULL;
char* endptr = NULL;

bool flash_jumploader = false;

Expand Down Expand Up @@ -301,7 +302,6 @@ int main(int argc, char* argv[])
file_name = optarg;
break;
case 'o': // offset
char *endptr;
offset = strtol(optarg, &endptr, 0);
if (errno == ERANGE || *endptr != '\0') {
fprintf(stderr, "ERROR: invalid offset value -'%s'.\n", optarg);
Expand Down

0 comments on commit 1976010

Please sign in to comment.