fix timestamp parsing on 32-bit platforms (#5192)

Fixes #5191
This commit is contained in:
nibon7 2022-04-14 21:52:32 +08:00 committed by GitHub
parent 7490392eb9
commit 2fe14a7a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,7 @@ impl Command for Touch {
let size = val.len();
// Each stamp is a 2 digit number and the whole stamp must not be less than 4 or greater than 7 pairs
if (size % 2 != 0 || !(8..=14).contains(&size)) || val.parse::<usize>().is_err() {
if (size % 2 != 0 || !(8..=14).contains(&size)) || val.parse::<u64>().is_err() {
return Err(ShellError::UnsupportedInput(
"input has an invalid timestamp".to_string(),
span,