From a3bc61ef94e7648709344032111a58cf858208f7 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 27 Sep 2015 17:58:59 +0200 Subject: [PATCH] bugfix in `CCString.find` --- src/core/CCString.cppo.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/CCString.cppo.ml b/src/core/CCString.cppo.ml index 4a176eb9..eb6c33db 100644 --- a/src/core/CCString.cppo.ml +++ b/src/core/CCString.cppo.ml @@ -94,7 +94,7 @@ let find ?(start=0) ~sub s = let n = String.length sub in let i = ref start in try - while !i + n < String.length s do + while !i + n <= String.length s do if _is_sub ~sub 0 s !i ~len:n then raise Exit; incr i done;