Skip to content

Commit

Permalink
FIX: reverted GCC compiler-specific directive but used only with GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Apr 16, 2024
1 parent 01bccc0 commit 58c9699
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/os/posix/host-readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 58c9699

Please sign in to comment.