diff --git a/src/exec.rs b/src/exec.rs index 6eeeef8df..f1f2ea738 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -397,12 +397,12 @@ fn safe_launch_process( if err.0 == ENOEXEC && is_thompson_shell_script(actual_cmd) { // Construct new argv. // We must not allocate memory, so only 128 args are supported. - const maxargs: usize = 128; + const MAXARGS: usize = 128; let nargs = argv.len(); let argv = unsafe { slice::from_raw_parts(argv.get(), nargs) }; - if nargs <= maxargs { + if nargs <= MAXARGS { // +1 for /bin/sh, +1 for terminating nullptr - let mut argv2 = [std::ptr::null(); 1 + maxargs + 1]; + let mut argv2 = [std::ptr::null(); 1 + MAXARGS + 1]; let bshell = PATH_BSHELL.as_ptr() as *const c_char; argv2[0] = bshell as *mut c_char; argv2[1..argv.len() + 1].copy_from_slice(argv); diff --git a/src/history.rs b/src/history.rs index 4319dedc0..08a25a150 100644 --- a/src/history.rs +++ b/src/history.rs @@ -1181,13 +1181,13 @@ fn format_history_record( let mut timestamp = MaybeUninit::uninit(); if let Some(show_time_format) = show_time_format.and_then(|s| CString::new(s).ok()) { if !unsafe { libc::localtime_r(&seconds, timestamp.as_mut_ptr()).is_null() } { - const max_tstamp_length: usize = 100; - let mut timestamp_str = [0_u8; max_tstamp_length]; + const MAX_TIMESTAMP_LENGTH: usize = 100; + let mut timestamp_str = [0_u8; MAX_TIMESTAMP_LENGTH]; use libc::strftime; if unsafe { strftime( &mut timestamp_str[0] as *mut u8 as *mut libc::c_char, - max_tstamp_length, + MAX_TIMESTAMP_LENGTH, show_time_format.as_ptr(), timestamp.as_ptr(), )