mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
using zeroStr() before giving string to Receive(). -- noch
This commit is contained in:
parent
efb4460ce9
commit
0063418fc0
1 changed files with 14 additions and 0 deletions
14
IRC.Mod
14
IRC.Mod
|
|
@ -40,6 +40,18 @@ VAR
|
|||
|
||||
(* string operations *)
|
||||
|
||||
PROCEDURE zeroStr(VAR str: ARRAY OF CHAR);
|
||||
VAR
|
||||
i, j : LONGINT;
|
||||
BEGIN
|
||||
i := LEN(str);
|
||||
j := 0;
|
||||
REPEAT
|
||||
str[j] := 0X;
|
||||
INC(j)
|
||||
UNTIL j = i;
|
||||
END zeroStr;
|
||||
|
||||
PROCEDURE findChar(ch: CHAR; VAR line: ARRAY OF CHAR; VAR b: BOOLEAN; VAR pos: INTEGER);
|
||||
VAR
|
||||
i : INTEGER;
|
||||
|
|
@ -215,6 +227,8 @@ PROCEDURE Receive*(VAR inst: instance; VAR str: ARRAY OF CHAR): BOOLEAN;
|
|||
VAR
|
||||
b: BOOLEAN;
|
||||
BEGIN
|
||||
(*COPY ("", str);*)
|
||||
zeroStr(str);
|
||||
b := Internet.Read(inst.connection, str);
|
||||
IF b THEN
|
||||
Out.String("received:"); Out.Ln;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue