Skip to content

Commit

Permalink
Merge pull request #118 from zowe/copy-env-with-null
Browse files Browse the repository at this point in the history
Appending the copied env string with NULL character before trimming.
  • Loading branch information
1000TurquoisePogs authored Jun 18, 2024
2 parents defc878 + f40ce5e commit 202f73a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ static const char **env_comp(zl_comp_t *comp) {
char *thisEnv = *env;
char *aux = malloc(strlen(thisEnv) + 1);
strncpy(aux, thisEnv, strlen(thisEnv));
aux[strlen(thisEnv)] = '\0';
trimRight(aux, strlen(aux));
env_comp[i] = aux;
i++;
Expand Down

0 comments on commit 202f73a

Please sign in to comment.