[host][openbsd][v3] Fix wrong OpenBSD user count

This commit is contained in:
shirou 2021-05-29 13:40:07 +09:00
parent 2782a109dc
commit ddef7ea64d
1 changed files with 1 additions and 1 deletions

View File

@ -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{