aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.rs b/src/util.rs
index 5a56c55..b9b1a68 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -75,10 +75,10 @@ pub fn get_last_error() -> Error {
}
}
-pub fn generate_password(length: usize) -> Result<Vec<u8>, Error> {
+pub fn generate_password(length: usize) -> Result<CString, Error> {
let mut data = vec![0u8; length];
OsRng.fill_bytes(&mut data[..]);
- Ok(data)
+ get_cstring(data)
}
pub fn get_cstring<T: Into<Vec<u8>>>(s: T) -> Result<CString, Error> {