changeset 715:6f627f4f11db

Fix th_strncasecmp() edge case.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 28 Apr 2020 18:38:23 +0300
parents ec6a3790a91b
children 7aee25fbc504
files th_string.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_string.c	Mon Apr 27 03:33:48 2020 +0300
+++ b/th_string.c	Tue Apr 28 18:38:23 2020 +0300
@@ -511,7 +511,7 @@
         n--;
     }
 
-    return th_tolower(*s1) - th_tolower(*s2);
+    return (n == 0) ? 0 : th_tolower(*s1) - th_tolower(*s2);
 }