# HG changeset patch # User Matti Hamalainen # Date 1588088303 -10800 # Node ID 6f627f4f11db784b9002a90061ff1a12059d84a4 # Parent ec6a3790a91b312495a32e672fbbf68d211175b1 Fix th_strncasecmp() edge case. diff -r ec6a3790a91b -r 6f627f4f11db th_string.c --- 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); }