mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-30 16:21:30 +00:00
[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:
1 parent
4706a60e8a
commit
1805d1f87d
1 file changed
+1
-1
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user