mirror of https://github.com/containers/podman.git
Merge pull request #12079 from stweil/lgtm
[NO NEW TESTS NEEDED] Fix off-by-one index comparision (reported by LGTM)
This commit is contained in:
commit
dbe770e3ce
|
@ -332,7 +332,7 @@ func readKernelVersion() (string, error) {
|
|||
return "", err
|
||||
}
|
||||
f := bytes.Fields(buf)
|
||||
if len(f) < 2 {
|
||||
if len(f) < 3 {
|
||||
return string(bytes.TrimSpace(buf)), nil
|
||||
}
|
||||
return string(f[2]), nil
|
||||
|
|
Loading…
Reference in New Issue