--- a/sys/ddb/db_input.c
+++ b/sys/ddb/db_input.c
@@ -264,7 +264,8 @@
*db_le++ = c;
return (1);
default:
- if (db_le == db_lbuf_end) {
+ if (db_le >= db_lbuf_end - 2) {
+ /* keep room for the trailing '\n' and NUL */
cnputc('\007');
}
else if (c >= ' ' && c <= '~') {