From f5de3da2f8882bc8477ebbed106ed3f70f54544a Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 27 Apr 2021 18:43:22 +0200 Subject: Don't use strncat() with length derived from source string This fixes Wstringop-overflow and Wstringop-truncation GCC warnings. See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=88059 --- lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 01cdbd0..717979b 100644 --- a/lib.c +++ b/lib.c @@ -151,8 +151,8 @@ make_filepath (char *path, char *filename) if (filepath == NULL) return NULL; - strncpy (filepath, path, length); - strncat (filepath, filename, strlen (filename)); + strcpy (filepath, path); + strcat (filepath, filename); return filepath; } -- cgit v1.2.3