[lldb] Fix -Wstringop-truncation in PythonReadline.cpp

The size is known and the truncation is deliberate -- use memcpy instead
of strncpy.
This commit is contained in:
Pavel Labath
2019-12-21 11:33:42 +01:00
parent 4706a60e8a
commit 1805d1f87d

View File

@@ -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';