Skip to content
Snippets Groups Projects
Commit 373dca29 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 73783e2b
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment