From 1805d1f87d7835b237f85bfb0595d1f411ebf1bf Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sat, 21 Dec 2019 11:33:42 +0100 Subject: [lldb] Fix -Wstringop-truncation in PythonReadline.cpp The size is known and the truncation is deliberate -- use memcpy instead of strncpy. --- lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp index 674ec9b6140..5f6429f5cd0 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp @@ -67,7 +67,7 @@ simple_readline(FILE *stdin, FILE *stdout, char *prompt) char *ret = (char *)PyMem_Malloc(n + 2); #endif if (ret) { - strncpy(ret, line, n); + memcpy(ret, line, n); free(line); ret[n] = '\n'; ret[n + 1] = '\0'; -- cgit v1.2.3