From 69eff35cd5758aa4a6d299989342ae0e08894a8f Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Fri, 24 Jul 2015 16:15:04 +0100 Subject: [PATCH] Fixed incorrect failsafe return values --- drivers/nrex/regex.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/nrex/regex.cpp b/drivers/nrex/regex.cpp index 708e68cc265..0a813c34907 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);