diff --git a/src/main.rs b/src/main.rs index c95c7fd..ba98571 100644 --- a/src/main.rs +++ b/src/main.rs @@ -181,7 +181,10 @@ fn get_hostname() -> Option { fn get_machine_id() -> Option { match std::fs::read_to_string(RPI_SERIAL_PATH) { - Ok(s) => match Uuid::parse_str(&format!("{:0>32}", s)) { + Ok(s) => match Uuid::parse_str(&format!( + "{:0>32}", + s.trim_end_matches('\0') + )) { Ok(u) => return Some(u), Err(e) => { debug!("Invalid UUID: {}", e);