Commit ad46cc3a authored by Jordan Petridis's avatar Jordan Petridis 🌱 Committed by Federico Mena Quintero Fix usize cast

Previously we were casting usize, returned from the .len() method,
to a u64 and later convert that to libc::c_ulong in the C bindings.

But libc::ulong is u64 in amd64, but represented as u32 in i686,
which results into a type missmatch whe compiled in i686.

Givem that libc::c_ulong seems to behave like usize, it should be
safe cast usize to libc::c_ulong directly.
parent 1fd5599c
......@@ -99,7 +99,7 @@ fn parse_into_handle(handle: *mut RsvgHandle, buf: &str) {
(*doc_handler).app_data = &handler_data as *const _ as gpointer;
let buf_ptr = buf.as_ptr() as *mut _;
let buf_len = buf.len() as u64;
let buf_len = buf.len() as libc::c_ulong;
let parser = cr_parser_new_from_buf(buf_ptr, buf_len, CR_UTF_8, false.to_glib());
if parser.is_null() {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment