AmendHub

Download:

jcs

/

subtext

/

amendments

/

392

fidopkt: INTL lines are only on private mail, pad MSGID to 8 chars


jcs made amendment 392 about 1 year ago
--- fidopkt.c Fri Mar 10 13:52:11 2023 +++ fidopkt.c Sat Mar 11 09:02:35 2023 @@ -547,18 +547,21 @@ fidopkt_encode(struct fidopkt *pkt, char **ret_buf, ch memcpy(buf + off, scratch, len); off += len; } - - /* kludge line: INTL to from, \r-terminated */ - len = snprintf(scratch, sizeof(scratch), "%cINTL %d:%d/%d %d:%d/%d\r", - 0x1, pkt->dest.zone, pkt->dest.net, pkt->dest.node, - pkt->orig.zone, pkt->orig.net, pkt->orig.node); - if (len > sizeof(scratch)) - goto fail; - if (!grow_to_fit(&buf, &buf_size, off, len, len)) - goto fail; - memcpy(buf + off, scratch, len); - off += len; + if (pkt->area[0] == '\0') { + /* kludge line: INTL to from, \r-terminated, but not on net mail */ + len = snprintf(scratch, sizeof(scratch), + "%cINTL %d:%d/%d %d:%d/%d\r", + 0x1, pkt->dest.zone, pkt->dest.net, pkt->dest.node, + pkt->orig.zone, pkt->orig.net, pkt->orig.node); + if (len > sizeof(scratch)) + goto fail; + if (!grow_to_fit(&buf, &buf_size, off, len, len)) + goto fail; + memcpy(buf + off, scratch, len); + off += len; + } + /* kludge line: TZOFF tzoff, \r-terminated */ len = snprintf(scratch, sizeof(scratch), "%cTZUTC: %+05d\r", 0x1, tzoff); @@ -570,7 +573,7 @@ fidopkt_encode(struct fidopkt *pkt, char **ret_buf, ch off += len; /* kludge line: MSGID zone:net/node id, \r-terminated */ - len = snprintf(scratch, sizeof(scratch), "%cMSGID: %d:%d/%d %lx\r", + len = snprintf(scratch, sizeof(scratch), "%cMSGID: %d:%d/%d %08lx\r", 0x1, pkt->msgid.zone, pkt->msgid.net, pkt->msgid.node, pkt->msgid.id); if (len > sizeof(scratch)) goto fail;