Skip to content

Commit

Permalink
fix【截取】
Browse files Browse the repository at this point in the history
  • Loading branch information
super1207 committed Oct 22, 2024
1 parent 9af269c commit fcb1665
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/redlang/exfun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ pub fn init_ex_fun_map() {
}
let sub_len:usize;
if len == "" {
sub_len = chs.len() - begen_pos;
if chs.len() < begen_pos {
sub_len = 0;
} else {
sub_len = chs.len() - begen_pos;
}
}else{
sub_len = len.parse::<usize>()?;
}
Expand All @@ -420,7 +424,11 @@ pub fn init_ex_fun_map() {
}
let sub_len:usize;
if len == "" {
sub_len = arr.len() - begen_pos;
if arr.len() < begen_pos {
sub_len = 0;
} else {
sub_len = arr.len() - begen_pos;
}
}else{
sub_len = len.parse::<usize>()?;
}
Expand Down

0 comments on commit fcb1665

Please sign in to comment.