summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-08-22 13:51:32 -0400
committerRich Felker <dalias@aerifal.cx>2020-08-22 13:51:32 -0400
commit9d4b25b4738dbabf628055601d96ba0609c2b4a8 (patch)
tree7c3af19d5a2eb339ccaab19a80f1b5f40655952c
parentd49cf07541bb54a5ac7aec1feec8514db33db8ea (diff)
downloadmusl-9d4b25b4738dbabf628055601d96ba0609c2b4a8.tar.gz
musl-9d4b25b4738dbabf628055601d96ba0609c2b4a8.tar.bz2
musl-9d4b25b4738dbabf628055601d96ba0609c2b4a8.tar.xz
musl-9d4b25b4738dbabf628055601d96ba0609c2b4a8.zip
fix MUSL_LOCPATH search
all path elements but the last had the final byte truncated.
-rw-r--r--src/locale/locale_map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/locale/locale_map.c b/src/locale/locale_map.c
index 2321bac0..e7eede62 100644
--- a/src/locale/locale_map.c
+++ b/src/locale/locale_map.c
@@ -67,7 +67,7 @@ const struct __locale_map *__get_locale(int cat, const char *val)
if (path) for (; *path; path=z+!!*z) {
z = __strchrnul(path, ':');
- l = z - path - !!*z;
+ l = z - path;
if (l >= sizeof buf - n - 2) continue;
memcpy(buf, path, l);
buf[l] = '/';