aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2019-12-10 23:38:59 -0700
committerkatherine <ageha@airen-no-jikken.icu>2019-12-10 23:38:59 -0700
commitcabda1be1f41ff9a1313aa99bdf7861d5742a011 (patch)
tree0ef05acf66e05e6dff735822aace160b822d73c3
parent9eadeef96ff35f12f2a44085e84d42d93c53c026 (diff)
downloadsimple-xdg-bdirs-cabda1be1f41ff9a1313aa99bdf7861d5742a011.tar.gz
another suppress pointless gcc errorHEADmaster
-rw-r--r--simple-xdg-bdirs.h3
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';