fix for endianness
This commit is contained in:
parent
ec09e7a251
commit
e8a7fac9b2
@ -317,6 +317,7 @@ int export_messages(int area) {
|
||||
}
|
||||
|
||||
if (areas[area]->hub == mynode) {
|
||||
msg_to_nl(&msg);
|
||||
for (n = 0; n < areas[area]->link_count; n++) {
|
||||
if (imhub) {
|
||||
snprintf(buffer, PATH_MAX, "%s/%d/", baseoutdir, areas[area]->links[n]);
|
||||
@ -334,14 +335,14 @@ int export_messages(int area) {
|
||||
} else {
|
||||
snprintf(buffer, PATH_MAX, "%s/%d/%d-%s.message", baseoutdir, hubnode, areas[area]->links[n], msgid);
|
||||
}
|
||||
msg.daddr = areas[area]->links[n];
|
||||
msg.daddr = htonl(areas[area]->links[n]);
|
||||
fptr = fopen(buffer, "wb");
|
||||
if (fptr == NULL) {
|
||||
fprintf(stderr, "Error creating file %s\n", buffer);
|
||||
continue;
|
||||
}
|
||||
|
||||
msg_to_nl(&msg);
|
||||
|
||||
|
||||
fwrite(&msg, sizeof(struct msg_t), 1, fptr);
|
||||
fwrite(body, strlen(body), 1, fptr);
|
||||
|
@ -297,6 +297,7 @@ int export_messages(int area) {
|
||||
msg.area = areas[area]->id;
|
||||
msg.type = 0;
|
||||
if (areas[area]->hub == mynode) {
|
||||
msg_to_nl(&msg);
|
||||
for (n = 0; n < areas[area]->link_count; n++) {
|
||||
if (imhub) {
|
||||
snprintf(buffer, PATH_MAX, "%s/%d/", baseoutdir, areas[area]->links[n]);
|
||||
@ -314,14 +315,14 @@ int export_messages(int area) {
|
||||
} else {
|
||||
snprintf(buffer, PATH_MAX, "%s/%d/%d-%s.message", baseoutdir, hubnode, areas[area]->links[n], msgid);
|
||||
}
|
||||
msg.daddr = areas[area]->links[n];
|
||||
msg.daddr = htonl(areas[area]->links[n]);
|
||||
fptr = fopen(buffer, "wb");
|
||||
if (fptr == NULL) {
|
||||
fprintf(stderr, "Error creating file %s\n", buffer);
|
||||
continue;
|
||||
}
|
||||
|
||||
msg_to_nl(&msg);
|
||||
|
||||
|
||||
fwrite(&msg, sizeof(struct msg_t), 1, fptr);
|
||||
fwrite(body, strlen(body), 1, fptr);
|
||||
|
Reference in New Issue
Block a user