diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-04-07 08:34:34 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-04-07 08:34:34 +0000 |
commit | 29ee8ab0ad390e4a1f1cf2c86aea9d1b5d3411a0 (patch) | |
tree | 997717b17f46bf50b6c3cecad8e17cd9ea170128 /src | |
parent | 18ecd877f51a5727f6a34f7174bf4b5516b9d337 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/hashcomp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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) |