Skip to content

Commit

Permalink
fix compilation error with new gcc
Browse files Browse the repository at this point in the history
Change-Id: I21f0754247643cd8978d9e08b8ddb9ef79855c6e
  • Loading branch information
Jonathan Klee committed Oct 4, 2018
1 parent 69370c4 commit 84b839f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ void load_configuration(struct configuration_t *config)
#endif /* __linux__ / __APPLE__ */

// If file does not exist, create a default ngprc and open it
char dir[PATH_MAX];
snprintf(dir, PATH_MAX, "%s/.config/%s", getenv("HOME"), CONFIG_DIR);
char dir[PATH_MAX - strlen(CONFIG_FILE)];
snprintf(dir, sizeof(dir), "%s/.config/%s", getenv("HOME"), CONFIG_DIR);
mkdir(dir, 0777);
snprintf(user_ngprc, PATH_MAX, "%s/%s", dir, CONFIG_FILE);
snprintf(user_ngprc, sizeof(dir), "%s/%s", dir, CONFIG_FILE);

if (access(user_ngprc, R_OK) < 0) {
create_user_ngprc(user_ngprc);
Expand Down

0 comments on commit 84b839f

Please sign in to comment.