diff options
author | katherine <ageha@airen-no-jikken.icu> | 2019-12-10 23:38:59 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2019-12-10 23:38:59 -0700 |
commit | cabda1be1f41ff9a1313aa99bdf7861d5742a011 (patch) | |
tree | 0ef05acf66e05e6dff735822aace160b822d73c3 | |
parent | 9eadeef96ff35f12f2a44085e84d42d93c53c026 (diff) | |
download | simple-xdg-bdirs-cabda1be1f41ff9a1313aa99bdf7861d5742a011.tar.gz |
-rw-r--r-- | simple-xdg-bdirs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/simple-xdg-bdirs.h b/simple-xdg-bdirs.h index e9aafc8..288b757 100644 --- a/simple-xdg-bdirs.h +++ b/simple-xdg-bdirs.h @@ -304,7 +304,8 @@ simple_xdg_bdirs_read_dirs(enum simple_xdg_bdirs_ftype type) goto abort; } - strncpy(*cur, s2 + l1, l2 - l1); + if (l2 - l1 != 0) + strncpy(*cur, s2 + l1, l2 - l1); (*cur)[l2 - l1] = '/'; (*cur)[l2 - l1 + 1] = '\0'; |