summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/readline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 7756e6b..7f366aa 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -1240,7 +1240,7 @@ static char *
call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
{
size_t n;
- char *p, *q;
+ char *p;
int signal;
#ifdef SAVE_LOCALE
@@ -1297,10 +1297,10 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
}
/* Copy the malloc'ed buffer into a PyMem_Malloc'ed one and
release the original. */
- q = p;
+ char *q = p;
p = PyMem_RawMalloc(n+2);
if (p != NULL) {
- strncpy(p, q, n);
+ memcpy(p, q, n);
p[n] = '\n';
p[n+1] = '\0';
}