diff --git a/Cargo.toml b/Cargo.toml index c6d5d39..36e8c56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ homepage = "https://github.com/Cisco-Talos/clamav-async-rs" license = "GPL-2.0" name = "clamav-async" repository = "https://github.com/Cisco-Talos/clamav-async-rs" -version = "0.2.0" +version = "0.2.1" keywords = ["antivirus", "async", "clamav"] [features] diff --git a/src/cvd/head_libclamav.rs b/src/cvd/head_libclamav.rs index b169e19..df6d034 100644 --- a/src/cvd/head_libclamav.rs +++ b/src/cvd/head_libclamav.rs @@ -15,7 +15,10 @@ // MA 02110-1301, USA. use super::{HeadError, Meta}; -use std::{borrow::Cow, ffi::CStr}; +use std::{ + borrow::Cow, + ffi::{c_char, CStr}, +}; /// The header of a CVD pub struct Header(*mut clamav_sys::cl_cvd); @@ -25,7 +28,7 @@ impl Meta for Header { /// (or CLD) file fn from_header_bytes(bytes: &[u8; 512]) -> Result { unsafe { - let raw = clamav_sys::cl_cvdparse(bytes.as_ptr() as *const i8); + let raw = clamav_sys::cl_cvdparse(bytes.as_ptr() as *const c_char); if raw.is_null() { Err(HeadError::Parse) diff --git a/src/engine.rs b/src/engine.rs index 45591c7..33130ff 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -19,7 +19,7 @@ use clamav_sys::cl_engine_field; use clamav_sys::{cl_error_t, time_t}; use core::num; use derivative::Derivative; -use std::ffi::NulError; +use std::ffi::{c_char, NulError}; use std::{path::Path, pin::Pin, sync::Arc, time}; #[cfg(windows)] @@ -45,7 +45,10 @@ pub enum ScanResult { } impl ScanResult { - pub(crate) fn from_ffi(scan_result: cl_error_t, c_virname: *const i8) -> Result { + pub(crate) fn from_ffi( + scan_result: cl_error_t, + c_virname: *const c_char, + ) -> Result { use std::ffi::CStr; match scan_result { diff --git a/src/lib.rs b/src/lib.rs index 848ca28..839f6ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,7 @@ pub use engine::Error as EngineError; pub use error::Error as ClamError; use lazy_static::lazy_static; use std::{ - ffi::CStr, + ffi::{c_char, CStr}, pin::Pin, sync::{Arc, Mutex, Once}, }; @@ -112,8 +112,8 @@ pub fn set_msg_callback(cb: MsgCallback) { /// unsafe extern "C" fn clcb_msg_wrapper( severity: clamav_sys::cl_msg, - fullmsg: *const i8, - msg: *const i8, + fullmsg: *const c_char, + msg: *const c_char, _context: *mut libc::c_void, ) { // Remap the log level to "standard" Rust log levels