changeset 2490:18ec4c092108

Fix dm_strncasecmp() edge case.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 28 Apr 2020 18:38:38 +0300
parents c64806412be0
children ed2f56abda22
files src/dmstring.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dmstring.c	Tue Apr 28 18:11:59 2020 +0300
+++ b/src/dmstring.c	Tue Apr 28 18:38:38 2020 +0300
@@ -45,7 +45,7 @@
         n--;
     }
 
-    return tolower(*s1) - tolower(*s2);
+    return (n == 0) ? 0 : tolower(*s1) - tolower(*s2);
 }