diff --git a/src/wall.c b/src/wall.c
index 92ffbc1..9c68338 100644
--- a/src/wall.c
+++ b/src/wall.c
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
 
   i = 0;
   for (p = buf; *p; p++) {
-	if (*p == '\n' && i++ > MAXLINES) {
+	if (*p == '\n' && ++i >= MAXLINES) {
 		*++p = 0;
 		break;
 	}
