diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.rs b/src/util.rs index c2936b6..1955431 100644 --- a/src/util.rs +++ b/src/util.rs @@ -37,9 +37,9 @@ pub fn path2bytes(p: &Path) -> Result<&[u8], Error> { #[cfg(windows)] pub fn path2bytes(p: &Path) -> Result<&[u8], Error> { match p.to_str() { - Some(s) => check(s), - None => Error::new(raw::LIBSSH2_ERROR_INVAL, - "only unicode paths on windows may be used"), + Some(s) => check(s.as_bytes()), + None => Err(Error::new(raw::LIBSSH2_ERROR_INVAL, + "only unicode paths on windows may be used")), } } |