diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2008-12-31 10:22:53 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2008-12-31 10:22:53 +0200 |
commit | fc21815dbbd3661f7eecb4bf41473ac5f908e451 (patch) | |
tree | 3e4e60d6338464a2c0d052a624579f518ce4a003 | |
parent | 61274f90b5bf7c9d33a8bd48d947fee549089224 (diff) | |
download | vdr-plugin-osdteletext-fc21815dbbd3661f7eecb4bf41473ac5f908e451.tar.gz vdr-plugin-osdteletext-fc21815dbbd3661f7eecb4bf41473ac5f908e451.tar.bz2 |
Error handling improvements.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | menu.c | 7 | ||||
-rw-r--r-- | txtrecv.c | 8 |
3 files changed, 8 insertions, 8 deletions
@@ -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 @@ -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); } } @@ -192,8 +192,12 @@ void Storage::getFilename(char *buffer, int bufLength, PageID page) { void Storage::prepareDirectory(tChannelID chan) { free(currentDir); - asprintf(¤tDir, "%s/%s", root, *chan.ToString()); - MakeDirs(currentDir, 1); + if (asprintf(¤tDir, "%s/%s", root, *chan.ToString()) == -1 || + !MakeDirs(currentDir, 1)) { + esyslog("OSD-Teletext: Error preparing directory for channel \"%s\"", + *chan.ToString()); + return; + } failedFreeSpace=false; } |