Eliminate a compiler warning in searchtimer.c

This commit is contained in:
kamel5 2019-04-06 19:07:43 +02:00
parent c7f0131d52
commit ae206f4768

View File

@ -242,9 +242,12 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
channelMin = NULL; channelMin = NULL;
channelMax = NULL; channelMax = NULL;
} else if (useChannel == 1) { } else if (useChannel == 1) {
int minNum = 0, maxNum = 0;
int fields = sscanf(values[value].c_str(), "%d-%d", &minNum, &maxNum);
if (fields == 0) { // stored with ID
char *channelMinbuffer = NULL; char *channelMinbuffer = NULL;
char *channelMaxbuffer = NULL; char *channelMaxbuffer = NULL;
int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer); int channels = sscanf(values[value].c_str(), "%m[^|]|%m[^|]", &channelMinbuffer, &channelMaxbuffer);
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
@ -252,6 +255,7 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
#endif #endif
if (!channelMin) { if (!channelMin) {
esyslog("ERROR: channel '%s' not defined", channelMinbuffer);
channelMin = channelMax = NULL; channelMin = channelMax = NULL;
useChannel = 0; useChannel = 0;
} }
@ -264,15 +268,16 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true); channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
#endif #endif
if (!channelMax) { if (!channelMax) {
esyslog("ERROR: channel '%s' not defined", channelMaxbuffer);
channelMin = channelMax = NULL; channelMin = channelMax = NULL;
useChannel = 0; useChannel = 0;
} }
} }
free(channelMinbuffer); free(channelMinbuffer);
free(channelMaxbuffer); free(channelMaxbuffer);
} else if (useChannel == 2) {
channelGroup = values[value];
} }
} else if (useChannel == 2)
channelGroup = values[value];
break; break;
case 7: case 7:
useCase = atoi(values[value].c_str()); useCase = atoi(values[value].c_str());