summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-11-22 19:53:27 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-11-22 19:53:27 +0800
commit6bdc8e7a1102b0536d6bdd7ae4d83b1f33b5784c (patch)
tree343477d7ce2d1f9fc02c58b0654d7e95a6366da5
parent781c9738c34a22979e6e26fa3a8ad04fd37bdfd0 (diff)
downloadk&r-exercises-6bdc8e7a1102b0536d6bdd7ae4d83b1f33b5784c.tar.gz
1.23
-rw-r--r--1/23.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/1/23.c b/1/23.c
index b27e60f..2a563cd 100644
--- a/1/23.c
+++ b/1/23.c
@@ -32,7 +32,7 @@ int main(int argc, char *argv[]) {
comment = NONE;
// try not to add redundant line breaks.
if (s[i - 1] != '\n')
- s[i] = '\n';
+ s[i++] = '\n';
} else if (comment == MULTILC && curr == '/' && prev == '*') {
comment = NONE;
}