summaryrefslogtreecommitdiffstats
path: root/5/11.c
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2022-01-27 21:41:35 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2022-01-27 21:41:35 +0800
commitac3618eeb0b8e676e9a4cdf227fda52818979274 (patch)
tree45acb1891aa8fa68d133346b9f18d45988a02149 /5/11.c
parent83139dbf46bf65742ef5a2d3f022913cffd52908 (diff)
downloadk&r-exercises-ac3618eeb0b8e676e9a4cdf227fda52818979274.tar.gz
5.11
Diffstat (limited to '5/11.c')
-rw-r--r--5/11.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/5/11.c b/5/11.c
index 72fe92f..2421627 100644
--- a/5/11.c
+++ b/5/11.c
@@ -110,11 +110,12 @@ void entab(char *s, char *t, int *tablist, int tablistc) {
else
col++;
} else {
- for (; col <= tablist[j++] && k < MAXTEXT; col++)
+ for (; col <= tablist[j] && k < MAXTEXT; col++)
t[k++] = ' ';
+ j++;
}
}
- }
- t[j] = 0;
+ t[k] = 0;
+ }
} \ No newline at end of file