Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Fix length check. (#352)
Browse files Browse the repository at this point in the history
The length of an array is never negative, so the condition as written can never hold.
  • Loading branch information
Max Schaefer authored and datoug committed Feb 11, 2019
1 parent fe8fb97 commit f872574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/rpm.go
Expand Up @@ -503,7 +503,7 @@ func (rpm *ringpopMonitorImpl) refresh(service string, currInfo *membershipInfo)
}

names, err := net.LookupAddr(tokens[0])
if err != nil || len(names) < 0 {
if err != nil || len(names) == 0 {
continue
}

Expand Down

0 comments on commit f872574

Please sign in to comment.