summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-02-28 15:18:31 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2010-02-28 15:18:31 +0100
commit44fdf301703c5866df6d4e36fe74a867ca5146a7 (patch)
tree7952fca297792f8d4d91df0822fcfbdee70dc789
parent9424ab26a67d40a5fe183535f9a881216ad721f9 (diff)
downloadvdr-44fdf301703c5866df6d4e36fe74a867ca5146a7.tar.gz
vdr-44fdf301703c5866df6d4e36fe74a867ca5146a7.tar.bz2
Fixed handling empty strings in cSource::FromString()
-rw-r--r--HISTORY4
-rw-r--r--config.h10
-rw-r--r--sources.c58
3 files changed, 39 insertions, 33 deletions
diff --git a/HISTORY b/HISTORY
index 94bddf12..199d0aff 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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().
diff --git a/config.h b/config.h
index e4237f75..74250ea6 100644
--- a/config.h
+++ b/config.h
@@ -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
diff --git a/sources.c b/sources.c
index 66d441d7..44bf7d07 100644
--- a/sources.c
+++ b/sources.c
@@ -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;
}