From 87dcf65013d363989c989a9f749bb31a126c28da Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 13 Oct 2014 07:04:36 -0700 Subject: Use the minimum of the two string lengths for comparison --- Alc/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Alc') diff --git a/Alc/helpers.c b/Alc/helpers.c index 8c9b1a4b..8407a8d3 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -726,7 +726,7 @@ void al_string_clear(al_string *str) static inline int al_string_compare(const al_string_char_type *str1, size_t str1len, const al_string_char_type *str2, size_t str2len) { - size_t complen = (str1len > str2len) ? str1len : str2len; + size_t complen = (str1len < str2len) ? str1len : str2len; int ret = memcmp(str1, str2, complen); if(ret == 0) { -- cgit v1.2.3