Skip to content

Commit

Permalink
Merge pull request #587 from Magister/fix/native_config_get
Browse files Browse the repository at this point in the history
Fix panic on getting config value from NativeConfig
  • Loading branch information
davidblewett committed Jan 19, 2024
2 parents eacf173 + 353812f commit e69c2aa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ impl NativeClientConfig {
}

// Convert the C string to a Rust string.
Ok(CStr::from_bytes_with_nul(&buf)
.unwrap()
.to_string_lossy()
.into())
Ok(String::from_utf8_lossy(&buf).to_string())
}
}

Expand Down

0 comments on commit e69c2aa

Please sign in to comment.