summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2008-12-31 10:22:53 +0200
committerVille Skyttä <ville.skytta@iki.fi>2008-12-31 10:22:53 +0200
commitfc21815dbbd3661f7eecb4bf41473ac5f908e451 (patch)
tree3e4e60d6338464a2c0d052a624579f518ce4a003
parent61274f90b5bf7c9d33a8bd48d947fee549089224 (diff)
downloadvdr-plugin-osdteletext-fc21815dbbd3661f7eecb4bf41473ac5f908e451.tar.gz
vdr-plugin-osdteletext-fc21815dbbd3661f7eecb4bf41473ac5f908e451.tar.bz2
Error handling improvements.
-rw-r--r--HISTORY1
-rw-r--r--menu.c7
-rw-r--r--txtrecv.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index 6c81117..667ffe5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9,6 +9,7 @@ VDR Plugin 'osdteletext' Revision History
- Removed obsolete options -R and -r
- Remove remnants of VDR < 1.6 support
- Updated Russian translation provided by Oleg Roitburd (Closes #46)
+- Improved error handling
2008-12-19: version 0.7.0
- switched completely to VDR 1.6's I18N system and removed the old crap - no
diff --git a/menu.c b/menu.c
index d8ce487..69e77f0 100644
--- a/menu.c
+++ b/menu.c
@@ -545,13 +545,8 @@ void TeletextBrowser::ShowPageNumber() {
void TeletextBrowser::ShowAskForChannel() {
if (selectingChannel) {
- char *str;
- if (selectingChannelNumber>0)
- asprintf(&str,"%s%d", tr("Channel (press OK): "), selectingChannelNumber);
- else
- asprintf(&str,"%s", tr("Channel (press OK): ") );
+ cString str = cString::sprintf(selectingChannelNumber > 0 ? "%s%d" : "%s", tr("Channel (press OK): "), selectingChannelNumber);
Display::DrawMessage(str);
- free(str);
}
}
diff --git a/txtrecv.c b/txtrecv.c
index 68bef84..c6d039f 100644
--- a/txtrecv.c
+++ b/txtrecv.c
@@ -192,8 +192,12 @@ void Storage::getFilename(char *buffer, int bufLength, PageID page) {
void Storage::prepareDirectory(tChannelID chan) {
free(currentDir);
- asprintf(&currentDir, "%s/%s", root, *chan.ToString());
- MakeDirs(currentDir, 1);
+ if (asprintf(&currentDir, "%s/%s", root, *chan.ToString()) == -1 ||
+ !MakeDirs(currentDir, 1)) {
+ esyslog("OSD-Teletext: Error preparing directory for channel \"%s\"",
+ *chan.ToString());
+ return;
+ }
failedFreeSpace=false;
}