Explorar el Código

* fixed range check error in HasDriveLetter when path is 1 character long

Nikolay Nikolov hace 4 años
padre
commit
fe903f2ae4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      rtl/wasi/system.pp

+ 1 - 1
rtl/wasi/system.pp

@@ -62,7 +62,7 @@ implementation
 
 function HasDriveLetter(const path: rawbytestring): Boolean;
 begin
-  HasDriveLetter:=(path<>'') and (UpCase(path[1]) in ['A'..'Z']) and (path[2] = ':');
+  HasDriveLetter:=(Length(path)>=2) and (UpCase(path[1]) in ['A'..'Z']) and (path[2] = ':');
 end;
 
 type