Skip to content

Commit

Permalink
Removed a trim and created default cases
Browse files Browse the repository at this point in the history
  • Loading branch information
martintc committed Apr 11, 2022
1 parent 3f4605f commit b684911
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions os_info/src/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ fn get_os() -> Type {
.arg("hardening.version")
.output()
.expect("Failed to check if is hardened");
match str::from_utf8(&check_hardening.stderr).trim() {
match str::from_utf8(&check_hardening.stderr) {
Ok("0\n") => return Type::HardenedBSD,
Ok(_) => return Type::Unknown,
Err(_) => return Type::FreeBSD,
}
}
},
Ok("MidnightBSD\n") => Type::MidnightBSD,
Ok(_) => Type::Unknown,
Err(_) => Type::Unknown,
}
}
Expand Down

0 comments on commit b684911

Please sign in to comment.