浏览代码

* Fix range check error for Not 0
* Fix loop in fdfillfdset

peter 22 年之前
父节点
当前提交
a7365ebcf8
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      rtl/unix/genfdset.inc

+ 7 - 3
rtl/unix/genfdset.inc

@@ -29,7 +29,7 @@ function fpFD_CLR(fdno:cint;var nset : TFDSet): cint;
 Begin
    if (fdno<=0) or (fdno >  FD_MAXFDSET) Then
        exit(-1);
-   nset[(fdno-1) shr ln2bitsinword]:=nset[(fdno-1) shr ln2bitsinword] AND NOT (1 shl ((fdno-1) and ln2bitmask));
+   nset[(fdno-1) shr ln2bitsinword]:=nset[(fdno-1) shr ln2bitsinword] AND Cardinal(NOT (1 shl ((fdno-1) and ln2bitmask)));
    fpFD_CLR:=0;
 End;
 
@@ -47,7 +47,7 @@ function fpfdfillset(var nset : TFDSet):cint;
 var i :longint;
 
 Begin
-  for i:=0 to wordsinsigset DO nset[i]:=NOT 0;
+  for i:=0 to wordsinsigset-1 DO nset[i]:=Cardinal(NOT 0);
   fpfdfillset:=0;
 End;
 
@@ -64,7 +64,11 @@ End;
 
 {
    $Log$
-   Revision 1.2  2003-09-16 16:13:56  marco
+   Revision 1.3  2003-09-22 19:43:22  peter
+     * Fix range check error for Not 0
+     * Fix loop in fdfillfdset
+
+   Revision 1.2  2003/09/16 16:13:56  marco
     * fdset functions renamed to fp<posix name>
 
    Revision 1.1  2003/09/14 20:16:48  marco