input->size++;
}
fseek(fptr, 0L, SEEK_SET);
- printf("file size of %s: %i byts\n", filename, input->size);
+ printf("file size of %s: %i bytes\n", filename, input->size);
input->data = malloc(sizeof(char) * input->size);
fread(input->data, input->size, 1, fptr);
byte_count++;
}
- printf("\nheader has %i bytes\n", byte_count);
+ char* header = malloc(sizeof(char) * byte_count);
+ snprintf(header, byte_count, "%s", data);
+ printf("\nheader:\n%s\n", header);
+ printf("header has %i bytes\n", byte_count);
+ free(header);
+ header = NULL;
}
int main(int argc, char* argv[])