[Dovecot] my_strncasecmp ignores max_chars
my_strncasecmp ignores the length parameter, which breaks all sorts of things on platforms where the function actually gets used.
Trivial patch attached.
-- Ben Winslow rain@bluecherry.net
On 13.11.2006, at 16.39, Ben Winslow wrote:
my_strncasecmp ignores the length parameter, which breaks all sorts of things on platforms where the function actually gets used.
Thanks. Do you actually know such a platform? I had been thinking
earlier that maybe I should just drop them out completely.
On Mon, 13 Nov 2006 16:44:53 +0200 Timo Sirainen tss@iki.fi wrote:
On 13.11.2006, at 16.39, Ben Winslow wrote:
my_strncasecmp ignores the length parameter, which breaks all sorts of things on platforms where the function actually gets used.
Thanks. Do you actually know such a platform? I had been thinking earlier that maybe I should just drop them out completely.
Well, my man page suggests that the first 'formal' standard it appears in is POSIX.1-2001, so I'm sure such systems exist... I don't have access to any, though. ;) A little digging suggests that some old versions of SunOS, Solaris < 2.6, and VMS < 7.0 don't have it.
In my particular case, a bounds checker/malloc debugger I was using (bounds checking gcc[1], which is excellent, by the way) caused the configure test to fail, since strn?casecmp had an internal prototype.
[1] http://sourceforge.net/projects/boundschecking/
-- Ben Winslow rain@bluecherry.net
participants (2)
-
Ben Winslow
-
Timo Sirainen