Skip to content

Commit 036e0bb

Browse files
authored
Merge pull request #688 from KowalczykBartek/handle_nul_terminated_string
Remove nul chars from string before parsing to numerical values
2 parents e69c2aa + f1f1cbf commit 036e0bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl NativeClientConfig {
150150
}
151151

152152
// Convert the C string to a Rust string.
153-
Ok(String::from_utf8_lossy(&buf).to_string())
153+
Ok(String::from_utf8_lossy(&buf).trim_matches(char::from(0)).to_string())
154154
}
155155
}
156156

0 commit comments

Comments
 (0)