From cabda1be1f41ff9a1313aa99bdf7861d5742a011 Mon Sep 17 00:00:00 2001 From: katherine Date: Tue, 10 Dec 2019 23:38:59 -0700 Subject: another suppress pointless gcc error --- simple-xdg-bdirs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'; -- cgit v1.2.3