Buffer usage in Oberon.Mail.ReadText(...).
MODULE Mail IN Oberon; (** portable *) (* ejz, *) ... PROCEDURE ReadText(S: NetTools.Session; VAR R: Files.Rider); VAR buffer: ARRAY BufLen OF CHAR; ... BEGIN ... IF len > (BufLen-2) THEN rlen := BufLen-2 ELSE rlen := len END; NetSystem.ReadBytes(S.C, 0, rlen, buffer); Appears that the last two bytes of buffer are reserved. No obvious requirement in NetSystem.ReadBytes. Why not this? IF len > (BufLen) THEN rlen := BufLen ELSE rlen := len END; NetSystem.ReadBytes(S.C, 0, rlen, buffer); Thanks, ... Lyall E. -- Message composed and transmitted by software designed to avoid the complication and vulnerability of antivirus software. 123456789 123456789 123456789 123456789 123456789 123456789 123456789 Tel: +1 360 639 0202 +1 http://easthope.ca/Peter.html Bcc: peter at easthope. ca
According to the POP3 protocol (RFC1939) all messages will end with the two characters CR + LF. So the code just ignores those two last characters. br Jörg
Am 12.02.2019 um 21:09 schrieb <peter@easthope.ca> <peter@easthope.ca>:
MODULE Mail IN Oberon; (** portable *) (* ejz, *) ... PROCEDURE ReadText(S: NetTools.Session; VAR R: Files.Rider); VAR buffer: ARRAY BufLen OF CHAR; ... BEGIN ... IF len > (BufLen-2) THEN rlen := BufLen-2 ELSE rlen := len END; NetSystem.ReadBytes(S.C, 0, rlen, buffer);
Appears that the last two bytes of buffer are reserved. No obvious requirement in NetSystem.ReadBytes. Why not this?
IF len > (BufLen) THEN rlen := BufLen ELSE rlen := len END; NetSystem.ReadBytes(S.C, 0, rlen, buffer);
Thanks, ... Lyall E.
-- Message composed and transmitted by software designed to avoid the complication and vulnerability of antivirus software.
123456789 123456789 123456789 123456789 123456789 123456789 123456789 Tel: +1 360 639 0202 +1 http://easthope.ca/Peter.html Bcc: peter at easthope. ca -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
What a pity there was no such comment in the code... ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of JR [joerg.straube@iaeth.ch] Sent: Tuesday, February 12, 2019 5:00 PM According to the POP3 protocol (RFC1939) all messages will end with the two characters CR + LF. So the code just ignores those two last characters. br Jörg
participants (3)
-
JR -
peter@easthope.ca -
Skulski, Wojciech