Mercurial > hg > th-libs
changeset 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 | 7fca448847a3 |
files | th_string.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
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; }