Skip to content

Commit

Permalink
Fixed the check on argv[0] to ensure the variable "program" always (#546
Browse files Browse the repository at this point in the history
)

contains the base program name.
  • Loading branch information
mdlpstsci authored Apr 9, 2021
1 parent a5a7d35 commit e0f20b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/acs/calacs/acscte/maincte.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,13 @@ int doMainCTE (int argc, char **argv) {

/* Obtain program basename */
if ((program = strrchr(argv[0], '/')) != NULL) {

strcpy(program_buf, program + 1);
program = program_buf;

} else {

program = argv[0];
}

if (!strcmp(program, "acsforwardmodel.e")) {
Expand Down

0 comments on commit e0f20b7

Please sign in to comment.