This commit is contained in:
Andrew Pamment 2018-05-22 21:37:23 +10:00
parent ea2b6a5b56
commit db56915498

View File

@ -274,6 +274,15 @@ int import(char *filename) {
fread(&msg, sizeof(struct msg_t), 1, fptr);
body = malloc(st.st_size - sizeof(struct msg_t) + 1);
memset(body, 0, st.st_size - sizeof(struct msg_t) + 1);
fread(body, st.st_size - sizeof(struct msg_t), 1, fptr);
fclose(fptr);
for (i=0;i<area_count;i++) {
if (msg.area == areas[i]->id) {
areaid = i;
@ -298,20 +307,15 @@ int import(char *filename) {
ret = isdupe(&msg, uuid);
if (ret == -1) {
free(body);
fclose(fptr);
return 0;
} else if (ret == 1) {
free(body);
fclose(fptr);
return 1;
}
body = malloc(st.st_size - sizeof(struct msg_t) + 1);
memset(body, 0, st.st_size - sizeof(struct msg_t) + 1);
fread(body, st.st_size - sizeof(struct msg_t), 1, fptr);
fclose(fptr);
JAM_ClearMsgHeader(&jmh);
jmh.DateWritten = msg.timedate;