summaryrefslogtreecommitdiffstats
path: root/5
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2022-01-28 18:56:07 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2022-01-28 18:56:07 +0800
commita1ccfd9268152f086d83ac337a8def3984984f3e (patch)
tree00ac5a75418596df7ae02bd546df148f81fcd935 /5
parentdd259d62f1e8a8258187204885773ec12952a1e6 (diff)
downloadk&r-exercises-a1ccfd9268152f086d83ac337a8def3984984f3e.tar.gz
5.11
Diffstat (limited to '5')
-rw-r--r--5/11.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/5/11.c b/5/11.c
index 1e4a3f8..eb264f7 100644
--- a/5/11.c
+++ b/5/11.c
@@ -92,7 +92,7 @@ int gettablist(char *s, int *t) {
void entab(char *s, char *t, int *tablist, int tablistc) {
int i, j, k;
- if (tablistc == 1) {
+ if (tablistc < 2) {
for (i = 0, j = 0; s[i] != 0 && j < MAXTEXT; i++) {
if (s[i] != ' ')
t[j++] = s[i];
@@ -108,13 +108,15 @@ void entab(char *s, char *t, int *tablist, int tablistc) {
}
t[j] = 0;
+ } else {
+ // todo
}
}
void detab(char *s, char *t, int *tablist, int tablistc) {
int i, j, k, col;
- if (tablistc == 1) {
+ if (tablistc < 2) {
for (i = 0, j = 0; j < MAXTEXT && (t[j] = s[i]) != 0; i++) {
if (s[i] == '\t') {
for (k = 0; k < TABSIZE && j < MAXTEXT; k++, j++)