функция должна заставить список заполнить ее и вернуть голову, она взорвется, когда достигнет mallo c, компилятор говорит, что «временный» может не заканчиваться нулем, что не правда, какая-то помощь?
std* FromFileToList(std* head, FILE* in) {
int i;
std* temp;
char temporary[257], c;
do {
if (!(temp = (std*)malloc(sizeof(temp)))) {
DeleteList(head);
Error_Msg("Memory allocation Error!");
}
fscanf(in, "%s %s %s %d %d %d", temp->code, temporary, temp->Dep, &temp->marks[0], &temp->marks[1], &temp->marks[2]);
for (i = 0; i < 3; i++)
temp->avg += (float)(temp->marks[i] / 3);
temp->name = (char*)malloc((strlen(temporary) + 1) * (sizeof(char)));//Error here
if (!(temp->name)) {
DeleteList(head);
Error_Msg("Memory allocation Error!");
}
strcpy(temp->name, temporary);[enter image description here][1]
temp->next = head;
head = temp;
c = fgetc(in);
} while (c != EOF);
return(head);
}