So I created have a program that basically prints any given string like that:

Example:
Input:

```
Hello

```

Output:

```
Hello
ello
llo
lo
o

```

The problem is that for some reason if I use `icdiff` and compare my output with that output in a text file it says that I am missing elements and that I have more spaces than it should.

Icdiff output:

```
Hello
 ello
  llo

```

As you can see this is clearly different than what I have, but if I test it on the terminal I get the expected output.

Program:

```
#include <stdio.h> 
#include <stdlib.h>
#include <string.h>

void print_array(char *p, int tamanho) {
    int i;
    for (i = 0; i < tamanho; i++) {
        printf("%c", p[i]);
    }
    printf("\n");
}

void nova_str(char *p, char *s, int inicio, int tamanho) {
    int i;
    for (i = inicio; i < tamanho; i++) {
        s[i] = p[i];
    }
}

int main() {
    char p[1001];
    int len;
    int j;
    scanf("%s", p);
    len = strlen(p);
    print_array(p, len);
    for (j = 1; j < len; j++) {
        char *np = (char *)calloc(len + 1, sizeof(char));
        nova_str(p, np, j, len);
        print_array(np, len);
        free(np);
    }
    return 0;
}

```

Really any help would be appreciated.