int terminate_string(char *c, int index) {
    int saw_null = 0;

    for (int i = 0; i < index; i++) {
        if (saw_null) {
            c[i] = '\0';
        }
        else {
            if (c[i] == '\0') {
                saw_null = i;
            }
        }
    }
    
}