Skip to content

Commit 4dabedf

Browse files
committed
Fix slash adding.
1 parent fa1aab9 commit 4dabedf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graphpass.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ int main (int argc, char *argv[]) {
145145
printf("Removing redundant slashes from filename.\n");
146146
path[strlen(path)+1] = '\0';
147147
}
148-
else if (FILENAME[0] != '/' && DIRECTORY[(sizeof(DIRECTORY)/sizeof(DIRECTORY[0])-2)] != '/') {
148+
else if (FILENAME[0] != '/' && DIRECTORY[strlen(DIRECTORY)-1] != '/') {
149+
printf("%s", DIRECTORY[strlen(DIRECTORY)]);
149150
printf("Adding slash separator.\n");
150151
strncat(path, "/", 1);
151152
printf ("Current path: %s.\n", path);

0 commit comments

Comments
 (0)