From ab069b7e594b4de202cd4b0a083379397e278339 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 4 Jun 2006 11:36:02 +0000 Subject: [PATCH] gcc 2.95 compatibility fixes git-svn-id: https://svn.musicpd.org/mpd/trunk@4244 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugins/_flac_common.c | 7 +++++-- src/inputPlugins/oggvorbis_plugin.c | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c index 79a3c38f2..93067ae68 100644 --- a/src/inputPlugins/_flac_common.c +++ b/src/inputPlugins/_flac_common.c @@ -114,13 +114,16 @@ static unsigned int commentMatchesAddToTag( MpdTag ** tag) { const char * str; + size_t slen; + int vlen; + switch (itemType) { case TAG_ITEM_TRACK: str = VORBIS_COMMENT_TRACK_KEY; break; case TAG_ITEM_DISC: str = VORBIS_COMMENT_DISC_KEY; break; default: str = mpdTagItemKeys[itemType]; } - size_t slen = strlen(str); - int vlen = entry->length - slen - 1; + slen = strlen(str); + vlen = entry->length - slen - 1; if ((vlen > 0) && (0 == strncasecmp(str,(char *)entry->entry, slen)) && (*(entry->entry + slen) == '=')) { diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c index 6881b9c41..224ac2f36 100644 --- a/src/inputPlugins/oggvorbis_plugin.c +++ b/src/inputPlugins/oggvorbis_plugin.c @@ -161,13 +161,14 @@ static inline unsigned int ogg_parseCommentAddToTag(char * comment, unsigned int itemType, MpdTag ** tag) { const char * needle; + unsigned int len; switch (itemType) { case TAG_ITEM_TRACK: needle = VORBIS_COMMENT_TRACK_KEY; break; case TAG_ITEM_DISC: needle = VORBIS_COMMENT_DISC_KEY; break; default: needle = mpdTagItemKeys[itemType]; } - unsigned int len = strlen(needle); - + len = strlen(needle); + if(strncasecmp(comment, needle, len) == 0 && *(comment+len) == '=') { if (!*tag) *tag = newMpdTag();