summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2022-01-31 13:08:30 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2022-01-31 13:08:30 +0800
commitf3b90d4a4d7e3eccab2953fa9d11f6e92ecc8dbd (patch)
tree09690a285a52b7676d0993cf30dcd316be4af259
parent2fa479c4c8247c2925dbf775a24d80499fa2fd70 (diff)
downloadk&r-exercises-f3b90d4a4d7e3eccab2953fa9d11f6e92ecc8dbd.tar.gz
5.11
-rw-r--r--5/11.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/5/11.c b/5/11.c
index 1145bf2..df1f6b3 100644
--- a/5/11.c
+++ b/5/11.c
@@ -120,9 +120,10 @@ void entab(char *s, char *t, int *tablist, int tablistc) {
} else {
for (m = j, n = l; n <= tablist[i] && s[m] == ' '; m++, n++)
;
- if (n == tablist[i]) {
+ if (n == tablist[i] + 1) {
t[k++] = '\t';
l = n + 1;
+ j = m - 1;
for (i += 1; i < tablistc && tablist[i] >= l; i++)
;
} else {