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;
channelMax = NULL;
} 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 *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
LOCK_CHANNELS_READ;
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);
#endif
if (!channelMin) {
esyslog("ERROR: channel '%s' not defined", channelMinbuffer);
channelMin = channelMax = NULL;
useChannel = 0;
}
@ -264,15 +268,16 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
#endif
if (!channelMax) {
esyslog("ERROR: channel '%s' not defined", channelMaxbuffer);
channelMin = channelMax = NULL;
useChannel = 0;
}
}
free(channelMinbuffer);
free(channelMaxbuffer);
} else if (useChannel == 2) {
channelGroup = values[value];
}
} else if (useChannel == 2)
channelGroup = values[value];
break;
case 7:
useCase = atoi(values[value].c_str());