From 4f57c7a8caa742faf31151be6773a0cc911e48c9 Mon Sep 17 00:00:00 2001 From: resver Date: Mon, 28 Sep 2009 08:40:30 +0000 Subject: [PATCH] Removed char substraction from compare_name(); char comparison logic must be in compare_char(). git-svn-id: http://exfat.googlecode.com/svn/trunk@8 60bc1c72-a15a-11de-b98f-4500b42dc123 --- libexfat/lookup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libexfat/lookup.c b/libexfat/lookup.c index 16591a8..0f60a31 100644 --- a/libexfat/lookup.c +++ b/libexfat/lookup.c @@ -224,12 +224,13 @@ static int compare_name(struct exfat* ef, const le16_t* a, const le16_t* b) { while (le16_to_cpu(*a) && le16_to_cpu(*b)) { - if (compare_char(ef, le16_to_cpu(*a), le16_to_cpu(*b)) != 0) - break; + int rc = compare_char(ef, le16_to_cpu(*a), le16_to_cpu(*b)); + if (rc != 0) + return rc; a++; b++; } - return le16_to_cpu(*a) - le16_to_cpu(*b); + return compare_char(ef, le16_to_cpu(*a), le16_to_cpu(*b)); } static int lookup_name(struct exfat* ef, struct exfat_node* node, -- 2.11.0