Skip to content

Commit

Permalink
Fix slash adding.
Browse files Browse the repository at this point in the history
  • Loading branch information
greebie committed Mar 14, 2018
1 parent fa1aab9 commit 4dabedf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphpass.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ int main (int argc, char *argv[]) {
printf("Removing redundant slashes from filename.\n");
path[strlen(path)+1] = '\0';
}
else if (FILENAME[0] != '/' && DIRECTORY[(sizeof(DIRECTORY)/sizeof(DIRECTORY[0])-2)] != '/') {
else if (FILENAME[0] != '/' && DIRECTORY[strlen(DIRECTORY)-1] != '/') {
printf("%s", DIRECTORY[strlen(DIRECTORY)]);
printf("Adding slash separator.\n");
strncat(path, "/", 1);
printf ("Current path: %s.\n", path);
Expand Down

0 comments on commit 4dabedf

Please sign in to comment.