From f70929022017d6f1cd8538cc2a26614e5fbd7e19 Mon Sep 17 00:00:00 2001 From: yexo Date: Thu, 11 Feb 2010 15:08:55 +0000 Subject: (svn r19095) -Fix: segfault when a baseset has an empty metadata field --- src/base_media_func.h | 2 +- src/music.cpp | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/base_media_func.h b/src/base_media_func.h index 434a6c722..bed6e57e9 100644 --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -24,7 +24,7 @@ template /* static */ Tbase_set *BaseMedia::availab */ #define fetch_metadata(name) \ item = metadata->GetItem(name, false); \ - if (item == NULL || strlen(item->value) == 0) { \ + if (item == NULL || StrEmpty(item->value)) { \ DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing", name); \ return false; \ } diff --git a/src/music.cpp b/src/music.cpp index b095a4197..e902f4b80 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -56,17 +56,6 @@ template return BaseMedia::used_set != NULL; } -/** - * Try to read a single piece of metadata and return false if it doesn't exist. - * @param name the name of the item to fetch. - */ -#define fetch_name(name) \ - item = metadata->GetItem(name, false); \ - if (item == NULL || strlen(item->value) == 0) { \ - DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing", name); \ - return false; \ - } - bool MusicSet::FillSetDetails(IniFile *ini, const char *path) { bool ret = this->BaseSet::FillSetDetails(ini, path); @@ -81,7 +70,7 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path) } IniItem *item = names->GetItem(filename, false); - if (item == NULL || strlen(item->value) == 0) { + if (item == NULL || StrEmpty(item->value)) { DEBUG(grf, 0, "Base music set song name missing: %s", filename); return false; } -- cgit v1.2.3-70-g09d2