summaryrefslogtreecommitdiffstats
path: root/1/18.c
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-11-20 21:22:22 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-11-20 21:22:22 +0800
commit6a047d173de71046d9e10d07fcbd39bbaf9078ed (patch)
tree8590e2f2cf935613f568342386bfad3858d5554f /1/18.c
parente8064efb940701215fb9c0576c997a13e7b67feb (diff)
downloadk&r-exercises-6a047d173de71046d9e10d07fcbd39bbaf9078ed.tar.gz
1.17:
Diffstat (limited to '1/18.c')
-rw-r--r--1/18.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/1/18.c b/1/18.c
index ace507f..86436db 100644
--- a/1/18.c
+++ b/1/18.c
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
int getlineraw(char s[], int size) {
int c, i;
- for (i = 0; i < size - 1 && (c = getchar()) != EOF && c != '\n'; i++)
+ for (i = 0; i < size && (c = getchar()) != EOF && c != '\n'; i++)
s[i] = c;
return c != '\n' && c != EOF ? -1 : i;