Skip to content

Commit 8e0dc98

Browse files
committed
Fix some overflow errors
1 parent dabd8b2 commit 8e0dc98

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "glob"
4-
version = "0.2.1"
4+
version = "0.2.2"
55
authors = ["The Rust Project Developers"]
66
license = "MIT/Apache-2.0"
77
homepage = "https://github.com/rust-lang/glob"

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ impl Pattern {
497497
}
498498
'[' => {
499499

500-
if i <= chars.len() - 4 && chars[i + 1] == '!' {
500+
if i + 4 <= chars.len() && chars[i + 1] == '!' {
501501
match chars[i + 3..].position_elem(&']') {
502502
None => (),
503503
Some(j) => {
@@ -508,7 +508,7 @@ impl Pattern {
508508
continue;
509509
}
510510
}
511-
} else if i <= chars.len() - 3 && chars[i + 1] != '!' {
511+
} else if i + 3 <= chars.len() && chars[i + 1] != '!' {
512512
match chars[i + 2..].position_elem(&']') {
513513
None => (),
514514
Some(j) => {

0 commit comments

Comments
 (0)