use StrToIntDef to return a default value of 0 incase pgrep returns an invalid Integer

This commit is contained in:
Pradeep Gowda 2015-05-27 23:18:30 -04:00
parent 42aa1e67eb
commit a0ff81dc4a
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, StrUtils,
Classes, SysUtils,
{$IFDEF WINDOWS}
Windows, JwaTlHelp32,
{$ENDIF}
@ -939,7 +939,7 @@ begin
lst := TStringList.Create;
try
lst.LoadFromStream(proc.Output);
Result := StrToInt(Trim(lst.Text));
Result := StrToIntDef(Trim(lst.Text), 0);
finally
lst.Free;
end;