• Victor Stinner's avatar
    Fix compiler warning in call_readline() (GH-10820) · 1600f604
    Victor Stinner authored
    Replace strncpy() with memcpy() in call_readline() to fix the
    following warning, the NUL byte is written manually just after:
    
    Modules/readline.c: In function ‘call_readline’:
    Modules/readline.c:1303:9: warning: ‘strncpy’ output truncated before
    terminating nul copying as many bytes from a string as its length
    [-Wstringop-truncation]
             strncpy(p, q, n);
             ^~~~~~~~~~~~~~~~
    Modules/readline.c:1279:9: note: length computed here
         n = strlen(p);
             ^~~~~~~~~
    1600f604
readline.c 37.4 KB