fix: Correct conversion of int with specific bit size (#9933)

This commit is contained in:
Sebastian Spaink 2021-10-18 09:48:16 -05:00 committed by GitHub
parent e17561d13b
commit 2e230e6bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ func (p *Procstat) simpleSystemdUnitPIDs() ([]PID, error) {
if len(kv[1]) == 0 || bytes.Equal(kv[1], []byte("0")) {
return nil, nil
}
pid, err := strconv.Atoi(string(kv[1]))
pid, err := strconv.ParseInt(string(kv[1]), 10, 32)
if err != nil {
return nil, fmt.Errorf("invalid pid '%s'", kv[1])
}