Skip to main content

luaur_code_gen/functions/
is_printable_string_constant.rs

1pub fn is_printable_string_constant(str_ptr: *const core::ffi::c_char, len: usize) -> bool {
2    for i in 0..len {
3        unsafe {
4            let byte = *str_ptr.add(i) as u8;
5            if byte < b' ' {
6                return false;
7            }
8        }
9    }
10    true
11}