Fixed sscanf() return values.

This commit is contained in:
Rolf Ahrenberg 2007-09-16 13:44:09 +00:00
parent b6aabba854
commit 756a7626ed
1 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
*
* 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"
@ -79,19 +79,19 @@ cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, cIptvPro
{
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
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);
free(loc);
*Protocol = pUdpProtocol;
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);
free(loc);
*Protocol = pHttpProtocol;
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);
free(loc);
*Protocol = pFileProtocol;