[easytag/wip/core-refactoring: 2/4] Use strncmp() when case is not a factor



commit 52949647fe3c15c797dfbe190da58f9c4f61f49c
Author: David King <amigadave amigadave com>
Date:   Thu Feb 18 21:19:22 2016 +0000

    Use strncmp() when case is not a factor
    
    When comparing strings while looking for the multi-field separator (always
    " - " in EasyTAG), use strncmp() rather than strcasecmp().

 src/tags/id3v24_tag.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/tags/id3v24_tag.c b/src/tags/id3v24_tag.c
index 1226cc8..949d208 100644
--- a/src/tags/id3v24_tag.c
+++ b/src/tags/id3v24_tag.c
@@ -443,7 +443,9 @@ id3tag_read_file_tag (GFile *gfile,
         tmpupdate = libid3tag_Get_Frame_Str(frame, ~0, &string1);
         if (string1)
         {
-            if (strncasecmp(string1, EASYTAG_STRING_ENCODEDBY MULTIFIELD_SEPARATOR, 
strlen(EASYTAG_STRING_ENCODEDBY MULTIFIELD_SEPARATOR)) == 0)
+            if (strncmp (string1,
+                         EASYTAG_STRING_ENCODEDBY MULTIFIELD_SEPARATOR,
+                         strlen (EASYTAG_STRING_ENCODEDBY MULTIFIELD_SEPARATOR)) == 0)
             {
                 FileTag->encoded_by = g_strdup(&string1[sizeof(EASYTAG_STRING_ENCODEDBY) + 
sizeof(MULTIFIELD_SEPARATOR) - 2]);
                 g_free(string1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]