diff --git a/src/os/posix/host-readline.c b/src/os/posix/host-readline.c index 0ad096f44e..b7fc71332f 100644 --- a/src/os/posix/host-readline.c +++ b/src/os/posix/host-readline.c @@ -731,11 +731,16 @@ static struct termios Term_Attrs; // Initial settings, restored on exit // If we have leftovers: if (term->residue[0]) { +#pragma GCC diagnostic push +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif end = (int)LEN_BYTES(term->residue); if (end < len) len = end; COPY_STR(buf, term->residue, len); // terminated below COPY_MEM(term->residue, term->residue+len, end-len); // remove term->residue[end-len] = 0; +#pragma GCC diagnostic pop } else { // Read next few bytes. We don't know how many may be waiting.