aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2021-05-06 00:34:05 -0400
committerGitHub <noreply@github.com>2021-05-06 00:34:05 -0400
commitc429ae2f0790c3486e7e420f4f2883c6a530ccf0 (patch)
tree200ab1a431513fdae9bd2c8b6652c70947287918 /lib
parent562258a7663a8d6447c46059743b173e19196e76 (diff)
downloadcleanpath-c429ae2f0790c3486e7e420f4f2883c6a530ccf0.tar.gz
No sep ending (#2)
* Be extra sure not to inject a separator at the end of the output string
Diffstat (limited to 'lib')
-rw-r--r--lib/cleanpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cleanpath.c b/lib/cleanpath.c
index f94c66d..c7f8bc9 100644
--- a/lib/cleanpath.c
+++ b/lib/cleanpath.c
@@ -102,7 +102,7 @@ char *cleanpath_read(struct CleanPath *path) {
strcat(result, path->part[i]);
// Do not append path separator on final element
- if (path->part[i + 1] != NULL) {
+ if (path->part[i + 1] != NULL && *path->part[i + 1] != '\0') {
strcat(result, path->sep);
}
}