Skip to content

Commit

Permalink
Merge pull request #688 from KowalczykBartek/handle_nul_terminated_st…
Browse files Browse the repository at this point in the history
…ring

Remove nul chars from string before parsing to numerical values
  • Loading branch information
fede1024 authored Aug 3, 2024
2 parents e69c2aa + f1f1cbf commit 036e0bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl NativeClientConfig {
}

// Convert the C string to a Rust string.
Ok(String::from_utf8_lossy(&buf).to_string())
Ok(String::from_utf8_lossy(&buf).trim_matches(char::from(0)).to_string())
}
}

Expand Down

0 comments on commit 036e0bb

Please sign in to comment.