From 3af0438b4bccc599792f61a9f4be81b4bb36c3e3 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 30 May 2018 09:39:28 +0200 Subject: TestDriver: Replace strncpy with strcpy GCC 8.1.0 now gives an error if `strncpy` is called with a bound depending on the length of the source argument. Replace `strncpy` with `strcpy` as the length is known a priori. Fixes: #18038 --- Templates/TestDriver.cxx.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in index ff3c869..ac531c0 100644 --- a/Templates/TestDriver.cxx.in +++ b/Templates/TestDriver.cxx.in @@ -48,7 +48,7 @@ static char* lowercase(const char* string) if (new_string == NULL) { /* NOLINT */ return NULL; /* NOLINT */ } - strncpy(new_string, string, stringSize); + strcpy(new_string, string); for (p = new_string; *p != 0; ++p) { *p = CM_CAST(char, tolower(*p)); } -- cgit v0.12