diff options
| author | Sadeep Madurange <smadurange@users.noreply.github.com> | 2022-01-28 18:56:07 +0800 |
|---|---|---|
| committer | Sadeep Madurange <smadurange@users.noreply.github.com> | 2022-01-28 18:56:07 +0800 |
| commit | a1ccfd9268152f086d83ac337a8def3984984f3e (patch) | |
| tree | 00ac5a75418596df7ae02bd546df148f81fcd935 /5 | |
| parent | dd259d62f1e8a8258187204885773ec12952a1e6 (diff) | |
| download | k&r-exercises-a1ccfd9268152f086d83ac337a8def3984984f3e.tar.gz | |
5.11
Diffstat (limited to '5')
| -rw-r--r-- | 5/11.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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++) |
