1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Fixed sscanf() return values.

This commit is contained in:
Rolf Ahrenberg 2007-09-16 13:44:09 +00:00
parent b6aabba854
commit 756a7626ed

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.c,v 1.20 2007/09/16 13:38:20 rahrenbe Exp $ * $Id: device.c,v 1.21 2007/09/16 13:44:09 rahrenbe Exp $
*/ */
#include "common.h" #include "common.h"
@ -79,19 +79,19 @@ cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, cIptvPro
{ {
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex); debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
char *loc = NULL; char *loc = NULL;
if (sscanf(Param, "IPTV|UDP|%a[^|]|%u", &loc, IpPort) == 5) { if (sscanf(Param, "IPTV|UDP|%a[^|]|%u", &loc, IpPort) == 2) {
cString addr(loc, true); cString addr(loc, true);
free(loc); free(loc);
*Protocol = pUdpProtocol; *Protocol = pUdpProtocol;
return addr; return addr;
} }
else if (sscanf(Param, "IPTV|HTTP|%a[^|]|%u", &loc, IpPort) == 5) { else if (sscanf(Param, "IPTV|HTTP|%a[^|]|%u", &loc, IpPort) == 2) {
cString addr(loc, true); cString addr(loc, true);
free(loc); free(loc);
*Protocol = pHttpProtocol; *Protocol = pHttpProtocol;
return addr; return addr;
} }
else if (sscanf(Param, "IPTV|FILE|%a[^|]|%u", &loc, IpPort) == 5) { else if (sscanf(Param, "IPTV|FILE|%a[^|]|%u", &loc, IpPort) == 2) {
cString addr(loc, true); cString addr(loc, true);
free(loc); free(loc);
*Protocol = pFileProtocol; *Protocol = pFileProtocol;