summaryrefslogtreecommitdiffstats
path: root/1/17.c
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-11-20 22:12:39 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-11-20 22:12:39 +0800
commit3ea0f0211b4588476f3a92981ad8ed64b0715177 (patch)
tree67265e568e177eaf77e96b5d5cbd498b2b7cb06c /1/17.c
parent6a047d173de71046d9e10d07fcbd39bbaf9078ed (diff)
downloadk&r-exercises-3ea0f0211b4588476f3a92981ad8ed64b0715177.tar.gz
1.19
Diffstat (limited to '1/17.c')
-rw-r--r--1/17.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/1/17.c b/1/17.c
index 2797b10..70ee4f2 100644
--- a/1/17.c
+++ b/1/17.c
@@ -30,5 +30,5 @@ int cgetline(char s[], int max) {
s[i] = c;
s[i] = '\0';
- return c != '\n' && c != EOF ? -1 : i;
+ return c != '\n' && c != EOF ? -1 : i - 1;
} \ No newline at end of file