Skip to content

Commit

Permalink
Properly terminate results of env_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Nov 18, 2013
1 parent 6e0fc62 commit 35415e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ char** env_keys(char** env) {
if (index > 0) {
name = malloc(index + 1);
strncpy(name, env[i], index);
name[index] = '\0';
result[i] = name;
}
}
Expand Down

0 comments on commit 35415e5

Please sign in to comment.