diff options
author | Aaron Ball <nullspoon@iohq.net> | 2015-02-26 18:45:43 -0700 |
---|---|---|
committer | Aaron Ball <nullspoon@iohq.net> | 2015-02-26 18:45:43 -0700 |
commit | 593cadff343af86b46f144a098b300662d9dc869 (patch) | |
tree | 68f868317f2cf8177cec0fb86fd9c0bbe05bbe3e | |
parent | 30dd282acb2e5f33f0926a9d2ea1e75028ce39e0 (diff) | |
download | noteless-593cadff343af86b46f144a098b300662d9dc869.tar.gz noteless-593cadff343af86b46f144a098b300662d9dc869.tar.xz |
Fixed basename function
Was returning the path preceeding the basename (the basedir) rather than the
actual base name.
-rw-r--r-- | src/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c index 5ec2af5..e2ca4f4 100644 --- a/src/common.c +++ b/src/common.c @@ -168,7 +168,7 @@ int basename(char* path, char* out) { for(int i = path_len; i > 0; i--) { // Copy if an extension delimiter (a period) is found if(path[i] == '/') { - strncpy(out, path, i); + strcpy(out, &path[i + 1]); return i; } } |