From 29ee8ab0ad390e4a1f1cf2c86aea9d1b5d3411a0 Mon Sep 17 00:00:00 2001 From: special Date: Tue, 7 Apr 2009 08:34:34 +0000 Subject: Fix irc_char_traits::find to behave correctly when the character is not found. Bug #823, patch by Phoenix Fledgeling git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11291 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/hashcomp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hashcomp.cpp') diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 3db888af5..a2b1eab0b 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -154,7 +154,7 @@ const char* irc::irc_char_traits::find(const char* s1, int n, char c) { while(n-- > 0 && national_case_insensitive_map[(unsigned char)*s1] != national_case_insensitive_map[(unsigned char)c]) s1++; - return s1; + return (n >= 0) ? s1 : NULL; } irc::tokenstream::tokenstream(const std::string &source) : tokens(source), last_pushed(false) -- cgit v1.2.3