From 5d6ad2442b0ac97922403edda848697c9e9de399 Mon Sep 17 00:00:00 2001 From: Joao Carlos Mendes Luis Date: Sun, 26 Aug 2018 16:55:44 -0300 Subject: Fedora 28: Fix misc bounds check compiler warnings Fix a bunch of truncation compiler warnings that show up on Fedora 28 (GCC 8.0.1). Reviewed-by: Giuseppe Di Natale Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Issue #7368 Closes #7826 Closes #7830 --- tests/zfs-tests/tests/functional/ctime/ctime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/zfs-tests') diff --git a/tests/zfs-tests/tests/functional/ctime/ctime.c b/tests/zfs-tests/tests/functional/ctime/ctime.c index ba8af15fe..1cd183234 100644 --- a/tests/zfs-tests/tests/functional/ctime/ctime.c +++ b/tests/zfs-tests/tests/functional/ctime/ctime.c @@ -155,7 +155,7 @@ do_link(const char *pfile) return (-1); } - strncpy(pfile_copy, pfile, sizeof (pfile_copy)); + strncpy(pfile_copy, pfile, sizeof (pfile_copy)-1); pfile_copy[sizeof (pfile_copy) - 1] = '\0'; /* * Figure out source file directory name, and create -- cgit v1.2.3