Mercurial > hg > th-libs
diff th_string.c @ 458:694c85f4e354
Fix th_strrcasecmp(), it had a rather stupid bug.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 16 Feb 2018 22:21:01 +0200 |
parents | 85fa3d333556 |
children | 77ad030e82c9 |
line wrap: on
line diff
--- a/th_string.c Tue Jan 02 23:09:29 2018 +0200 +++ b/th_string.c Fri Feb 16 22:21:01 2018 +0200 @@ -823,8 +823,8 @@ if (slen < nlen) return NULL; - if (th_strcasecmp(str - nlen - 1, needle) == 0) - return str - nlen - 1; + if (th_strcasecmp(str + slen - nlen, needle) == 0) + return str + slen - nlen; else return NULL; }