I recently posted [Spaces To Tabs Converter](/q/142930) but it had lots of bugs, so I rewrote the code. I wanted to ask, is it good code? I didn't find any bugs.

```
#include <stdio.h>
#define TABVALUE 4
#define ARRAYSIZE 3

void emptyArray(int *a);

int main(void) {
    int c, d, s;
    int savedChars[ARRAYSIZE];
    c = s = d = 0;
    while ((c = getchar()) != EOF) {
        if (c == ' ') {
            s = 0;
            s++;
            for (int j = 0; j < TABVALUE - 1; j++) {
                d = getchar();
                if (d != EOF) {
                    savedChars[j] = d;
                    savedChars[j + 1] = '\0';
                    if (d == ' ') {
                        s++;
                    } else {
                        break;
                    }
                }
            }
            if (s == TABVALUE) {
                emptyArray(savedChars);
                putchar('\t');
                s = 0;
            } else {
                putchar(c);
                for (int i = 0; i < 3; i++) {
                    if (savedChars[i] != '\0') {
                        putchar(savedChars[i]);
                    }
                }
            }
        } else {
            if (c != EOF) putchar(c);
        }
    }
    return 0;
}

void emptyArray(int *a) {
    for (int i = 0; i < ARRAYSIZE; i++) {
        a[i] = '\0';
    }
}

```