Skip to content

Commit 692dc39

Browse files
authored
fix overflow in string.split, close #101 (#102)
1 parent e0bb9e2 commit 692dc39

File tree

1 file changed

+1
-1
lines changed
  • crates/compiler/src/builtin/functions

1 file changed

+1
-1
lines changed

crates/compiler/src/builtin/functions/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub(crate) fn str_split(mut args: ArgumentResult, visitor: &mut Visitor) -> Sass
155155
.into());
156156
}
157157
// note: `1 + limit_int` is required to match dart-sass
158-
s1.splitn(1 + limit_int as usize, &separator)
158+
s1.splitn(limit_int.saturating_add(1) as usize, &separator)
159159
.map(|s| Value::String(s.to_string(), QuoteKind::Quoted))
160160
.collect()
161161
};

0 commit comments

Comments
 (0)