Skip to content

Commit 408b333

Browse files
authored
Merge pull request #12 from apxxxxxxe/dev
Dev
2 parents 4247843 + 78c5a15 commit 408b333

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ pub extern "cdecl" fn unload() -> BOOL {
102102

103103
#[allow(clippy::missing_safety_doc)]
104104
#[no_mangle]
105-
pub unsafe extern "cdecl" fn request(h: HGLOBAL, len: *mut c_long) -> HGLOBAL {
105+
pub extern "cdecl" fn request(h: HGLOBAL, len: &mut c_long) -> HGLOBAL {
106106
const RESPONSE_400: &str = "SHIORI/3.0 400 Bad Request\r\n\r\n";
107-
let v = unsafe { GStr::capture(h, *len as usize) };
107+
let v = GStr::capture(h, *len as usize);
108108
let s = match v.to_utf8_str() {
109109
Ok(s) => s,
110110
Err(_) => {
@@ -128,6 +128,6 @@ pub unsafe extern "cdecl" fn request(h: HGLOBAL, len: *mut c_long) -> HGLOBAL {
128128
let bytes = response.to_string().into_bytes();
129129
let response_gstr = GStr::clone_from_slice_nofree(&bytes);
130130

131-
unsafe { *len = response_gstr.len() as c_long };
131+
*len = response_gstr.len() as c_long;
132132
response_gstr.handle()
133133
}

0 commit comments

Comments
 (0)