[Oberon] Buffer usage in Oberon.Mail.ReadText(...).

JR joerg.straube at iaeth.ch
Tue Feb 12 23:00:41 CET 2019


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 at easthope.ca> <peter at 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 at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list