From 40c3d28a413c80700cb973becc5078ee0e645702 Mon Sep 17 00:00:00 2001 From: jD91mZM2 <me@krake.one> Date: Wed, 8 Aug 2018 19:29:02 +0200 Subject: [PATCH] fixup! Fix a few ffmpeg issues --- src/stdlib/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stdlib/src/lib.rs b/src/stdlib/src/lib.rs index c83bcdd0..d60ffc8a 100644 --- a/src/stdlib/src/lib.rs +++ b/src/stdlib/src/lib.rs @@ -728,8 +728,9 @@ pub fn convert_integer(s: *const c_char, base: c_int) -> Option<(c_ulong, isize, let mut overflowed = false; loop { - // `-1 as usize` is -1 - // `-1 as u8 as usize` is 255 + // `-1 as usize` is usize::MAX + // `-1 as u8 as usize` is u8::MAX + // It extends by the sign bit unless we cast it to unsigned first. let val = unsafe { LOOKUP_TABLE[*s.offset(idx) as u8 as usize] }; if val == -1 || val as c_int >= base { break; -- GitLab