[easytag/wip/core-refactoring: 9/11] Use strncmp() when case is not a factor
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/core-refactoring: 9/11] Use strncmp() when case is not a factor
- Date: Thu, 18 Feb 2016 21:28:17 +0000 (UTC)
commit 58725a4a2767bb7b8a404cbe0da02e56da24248f
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]