Skip to content

Commit

Permalink
Merge pull request #1010 from gdbinit/openbsd-wrong-users-number-patch
Browse files Browse the repository at this point in the history
Fix wrong OpenBSD user count
  • Loading branch information
shirou authored May 29, 2021
2 parents b76e0ff + ab33d5e commit 2782a10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion host/host_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) {
var u Utmp
br := bytes.NewReader(b)
err := binary.Read(br, binary.LittleEndian, &u)
if err != nil || u.Time == 0 {
if err != nil || u.Time == 0 || u.Name[0] == 0 {
continue
}
user := UserStat{
Expand Down

0 comments on commit 2782a10

Please sign in to comment.