summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-05-02 15:09:59 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2010-05-02 15:09:59 +0200
commit88dc4e335137f13cc4a3cd82c6d15a38c494e969 (patch)
treefa879a927d6c3c72f32e99a89aba57fd4b67a262 /menu.c
parentc19c63530e9eba17e39c14c987ee30793eb999dd (diff)
downloadvdr-88dc4e335137f13cc4a3cd82c6d15a38c494e969.tar.gz
vdr-88dc4e335137f13cc4a3cd82c6d15a38c494e969.tar.bz2
Fixed a crash when creating a new channel if the channel list is empty
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/menu.c b/menu.c
index e3b49cee..9ace1f69 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 2.21 2010/03/12 16:03:07 kls Exp $
+ * $Id: menu.c 2.22 2010/05/02 14:28:26 kls Exp $
*/
#include "menu.h"
@@ -212,14 +212,15 @@ cMenuEditChannel::cMenuEditChannel(cChannel *Channel, bool New)
sourceParam = NULL;
if (channel) {
data = *channel;
+ strn0cpy(name, data.name, sizeof(name));
if (New) {
channel = NULL;
data.nid = 0;
data.tid = 0;
data.rid = 0;
}
- Setup();
}
+ Setup();
}
void cMenuEditChannel::Setup(void)
@@ -229,7 +230,6 @@ void cMenuEditChannel::Setup(void)
Clear();
// Parameters for all types of sources:
- strn0cpy(name, data.name, sizeof(name));
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));