From 7c354aa36ad761f825ae6e245035ad7319f24861 Mon Sep 17 00:00:00 2001 From: Erik Jakobsson Date: Tue, 27 Feb 2024 15:55:55 +0100 Subject: [PATCH] fix(util/channel_layout): strip trailing nul in `describe` results on 6.1 Co-authored-by: tilpner --- src/util/channel_layout.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/channel_layout.rs b/src/util/channel_layout.rs index 1ffa721d..d8a45253 100644 --- a/src/util/channel_layout.rs +++ b/src/util/channel_layout.rs @@ -245,7 +245,7 @@ impl ChannelLayout { if bytes_needed <= buf.len() { let s = String::from_utf8_lossy(&buf[..bytes_needed]); - Ok(Ok(s.into_owned())) + Ok(Ok(s.trim_end_matches('\0').to_owned())) } else { Ok(Err(bytes_needed))