diff options
author | Zher Huei Lee <lee.zh.92@gmail.com> | 2015-07-24 16:15:04 +0100 |
---|---|---|
committer | Zher Huei Lee <lee.zh.92@gmail.com> | 2015-07-24 16:15:04 +0100 |
commit | 69eff35cd5758aa4a6d299989342ae0e08894a8f (patch) | |
tree | 597b33bf8964c4d13089a35d3ed108b7895e1ead /drivers/nrex | |
parent | 87c1e16834a21ac1e42321811cb0efcda4b91b9a (diff) |
Fixed incorrect failsafe return values
Diffstat (limited to 'drivers/nrex')
-rw-r--r-- | drivers/nrex/regex.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nrex/regex.cpp b/drivers/nrex/regex.cpp index 708e68cc26..0a813c3490 100644 --- a/drivers/nrex/regex.cpp +++ b/drivers/nrex/regex.cpp @@ -82,9 +82,9 @@ Error RegEx::compile(const String& p_pattern) { int RegEx::find(const String& p_text, int p_start, int p_end) const { - ERR_FAIL_COND_V( !exp.valid(), false ); - ERR_FAIL_COND_V( p_text.length() < p_start, false ); - ERR_FAIL_COND_V( p_text.length() < p_end, false ); + ERR_FAIL_COND_V( !exp.valid(), -1 ); + ERR_FAIL_COND_V( p_text.length() < p_start, -1 ); + ERR_FAIL_COND_V( p_text.length() < p_end, -1 ); bool res = exp.match(p_text.c_str(), &captures[0], p_start, p_end); |