summaryrefslogtreecommitdiffstats
path: root/4
diff options
context:
space:
mode:
Diffstat (limited to '4')
-rw-r--r--4/10.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/4/10.c b/4/10.c
index 25b3e1a..1476640 100644
--- a/4/10.c
+++ b/4/10.c
@@ -122,6 +122,8 @@ int mgetline() {
for (i = 0; i < MAXLINE - 1 && (c = getchar()) != EOF; i++) {
line[i] = c;
+ if (c == '\n')
+ break;
}
line[i] = 0;