diff options
author | Martin Pärtel <martin.partel@gmail.com> | 2020-05-13 20:17:51 +0300 |
---|---|---|
committer | Martin Pärtel <martin.partel@gmail.com> | 2020-05-13 20:18:53 +0300 |
commit | be5718d9273f63e40427166c59036ebc13120d08 (patch) | |
tree | 22c3e953177b820a72c039cd316ccfdda59ea3d5 /src | |
parent | e01b9c963d4d0db01d88ae91a33d1d083b9123eb (diff) | |
download | bindfs-be5718d9273f63e40427166c59036ebc13120d08.tar.gz |
Fixed a line ending bug with uid/gid mapping files that I introduced when merging #85.
Diffstat (limited to 'src')
-rw-r--r-- | src/bindfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bindfs.c b/src/bindfs.c index 6668ab8..0d14447 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -1889,7 +1889,7 @@ static int parse_map_file(UserMap *map, UserMap *reverse_map, char *file, int as while ((read = getline(&line, &len, fp)) != -1) { // Remove newline in case someone builds a file with lines like 'a:b:123' by hand. // If we left the newline, strtok would return "123\n" as the last token. - if (read > 0) { + if (read > 0 && line[read - 1] == '\n') { line[read - 1] = '\0'; } |