diff options
author | Pavel Labath <pavel@labath.sk> | 2019-12-21 11:33:42 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-12-21 11:35:26 +0100 |
commit | 1805d1f87d7835b237f85bfb0595d1f411ebf1bf (patch) | |
tree | cb162854137e38ef6655a533c6098943a2c053e0 /lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp | |
parent | 4706a60e8a071f0c6a686c45ed08c7bab0bb8446 (diff) | |
download | bcm5719-llvm-1805d1f87d7835b237f85bfb0595d1f411ebf1bf.tar.gz bcm5719-llvm-1805d1f87d7835b237f85bfb0595d1f411ebf1bf.zip |
[lldb] Fix -Wstringop-truncation in PythonReadline.cpp
The size is known and the truncation is deliberate -- use memcpy instead
of strncpy.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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'; |