1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed handling empty strings in cSource::FromString()

This commit is contained in:
Klaus Schmidinger 2010-02-28 15:18:31 +01:00
parent 9424ab26a6
commit 44fdf30170
3 changed files with 39 additions and 33 deletions

View File

@ -6383,3 +6383,7 @@ Video Disk Recorder Revision History
- The option "Setup/DVB/Use Dolby Digital" now only controls whether Dolby Digital
tracks appear in the "Audio" menu. Dolby Digital is always recorded.
This obsoletes the DOLBYINREC patch.
2010-02-28: Version 1.7.14
- Fixed handling empty strings in cSource::FromString().

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 2.22 2010/02/05 15:38:32 kls Exp $
* $Id: config.h 2.23 2010/02/28 15:18:31 kls Exp $
*/
#ifndef __CONFIG_H
@ -22,13 +22,13 @@
// VDR's own version number:
#define VDRVERSION "1.7.13"
#define VDRVERSNUM 10713 // Version * 10000 + Major * 100 + Minor
#define VDRVERSION "1.7.14"
#define VDRVERSNUM 10714 // Version * 10000 + Major * 100 + Minor
// The plugin API's version number:
#define APIVERSION "1.7.13"
#define APIVERSNUM 10713 // Version * 10000 + Major * 100 + Minor
#define APIVERSION "1.7.14"
#define APIVERSNUM 10714 // Version * 10000 + Major * 100 + Minor
// When loading plugins, VDR searches them by their APIVERSION, which
// may be smaller than VDRVERSION in case there have been no changes to

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: sources.c 2.1 2010/02/28 12:00:31 kls Exp $
* $Id: sources.c 2.2 2010/02/28 15:15:39 kls Exp $
*/
#include "sources.h"
@ -55,35 +55,37 @@ cString cSource::ToString(int Code)
int cSource::FromString(const char *s)
{
if ('A' <= *s && *s <= 'Z') {
int code = int(*s) << 24;
if (code == stSat) {
int pos = 0;
bool dot = false;
bool neg = false;
while (*++s) {
switch (*s) {
case '0' ... '9': pos *= 10;
pos += *s - '0';
break;
case '.': dot = true;
break;
case 'E': neg = true; // fall through to 'W'
case 'W': if (!dot)
pos *= 10;
break;
default: esyslog("ERROR: unknown source character '%c'", *s);
return stNone;
}
}
if (neg)
pos = -pos;
code |= (pos & st_Pos);
if (!isempty(s)) {
if ('A' <= *s && *s <= 'Z') {
int code = int(*s) << 24;
if (code == stSat) {
int pos = 0;
bool dot = false;
bool neg = false;
while (*++s) {
switch (*s) {
case '0' ... '9': pos *= 10;
pos += *s - '0';
break;
case '.': dot = true;
break;
case 'E': neg = true; // fall through to 'W'
case 'W': if (!dot)
pos *= 10;
break;
default: esyslog("ERROR: unknown source character '%c'", *s);
return stNone;
}
}
if (neg)
pos = -pos;
code |= (pos & st_Pos);
}
return code;
}
return code;
else
esyslog("ERROR: unknown source key '%c'", *s);
}
else
esyslog("ERROR: unknown source key '%c'", *s);
return stNone;
}