summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/gets.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libstand/gets.c b/lib/libstand/gets.c
index 575134c..7d54b00 100644
--- a/lib/libstand/gets.c
+++ b/lib/libstand/gets.c
@@ -74,7 +74,7 @@ ngets(char *buf, int n)
putchar('\n');
break;
default:
- if ((n < 1) || ((lp - buf) < n)) {
+ if ((n < 1) || ((lp - buf) < n - 1)) {
*lp++ = c;
putchar(c);
}
OpenPOWER on IntegriCloud