Changeset - r28086:17bf59e99b2b
[Not reviewed]
master
0 1 0
Michael Lutz - 7 months ago 2023-11-02 23:40:17
michi@icosahedron.de
Fix: char_traits::find needs to return nullptr if nothing was found.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/string.cpp
Show inline comments
 
@@ -343,12 +343,12 @@ struct CaseInsensitiveCharTraits : publi
 
		return 0;
 
	}
 

	
 
	static const char *find(const char *s, int n, char a)
 
	static const char *find(const char *s, size_t n, char a)
 
	{
 
		while (n-- > 0 && toupper(*s) != toupper(a)) {
 
			++s;
 
		for (; n > 0; --n, ++s) {
 
			if (toupper(*s) == toupper(a)) return s;
 
		}
 
		return s;
 
		return nullptr;
 
	}
 
};
 

	
0 comments (0 inline, 0 general)