hedgewars/uUtils.pas
changeset 13898 8c702a4839ec
parent 13844 94d0d1ab7a0e
child 13900 6b2c87490f0a
--- a/hedgewars/uUtils.pas	Tue Oct 09 09:02:39 2018 -0400
+++ b/hedgewars/uUtils.pas	Tue Oct 09 09:58:33 2018 -0400
@@ -336,10 +336,9 @@
 // Success will be set to false when conversion failed.
 // See documentation on Val procedure for syntax of s
 function StrToInt(s: shortstring; var success: boolean): LongInt;
-var Code: Word;
 begin
-val(s, StrToInt, Code);
-success:= Code = 0;
+val(s, StrToInt);
+success:= StrToInt <> nil;
 end;
 
 // Convert string to longint, without error checking