Skip to content
Snippets Groups Projects
Commit d6eadf36 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Truncate trailing whitespace from FidoNet message header fields

It's unclear whether trailing whitespace is supposed to be significant or not
(FidoNet specs don't say), but I don't see any reason why "John Doe" and
"John Doe " should be considered unique senders or recipients. Remove any
trailing whitespace from message subjects too.

This change makes the trailing whitespace truncation in SMB hash functions
unnecessary (at least for SBBSecho-imported messages), but most (all?) other
message transports don't allow for this nonsense in the first place.
parent b1852011
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4354 passed
......@@ -2343,8 +2343,11 @@ bool fread_fmsghdr(fmsghdr_t* hdr, FILE* fp)
if(fread(hdr, sizeof(fmsghdr_t), 1, fp) != 1)
return false;
TERMINATE(hdr->from);
truncsp(hdr->from);
TERMINATE(hdr->to);
truncsp(hdr->to);
TERMINATE(hdr->subj);
truncsp(hdr->subj);
TERMINATE(hdr->time);
return true;
}
......@@ -5325,6 +5328,7 @@ char* freadstr(FILE* fp, char* str, size_t maxlen)
return NULL;
str[maxlen-1]=0; /* Force terminator */
truncsp(str);
return(str);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment