From 7f95e315e42f53213805651acc589088d773d5ad Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sat, 9 Oct 2010 04:51:56 +0200 Subject: [PATCH] chan_dect: fix codec-list parsing Signed-off-by: Patrick McHardy --- channels/chan_dect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channels/chan_dect.c b/channels/chan_dect.c index 737074ef5..0343c3538 100644 --- a/channels/chan_dect.c +++ b/channels/chan_dect.c @@ -452,7 +452,7 @@ static int dect_db_parse_codec_list(struct dect_pt *pt, const char *key, cl = pt->codec_list; } - tmp = strchr(val, '_'); + tmp = strchr(key, '_'); if (tmp == NULL) return -1; strncpy(num, tmp + 1, sizeof(num)); @@ -469,6 +469,9 @@ static int dect_db_parse_codec_list(struct dect_pt *pt, const char *key, cl->entry[i].cplane = dect_parse_num(val); else return -1; + + if (i + 1 > cl->num) + cl->num = i + 1; return 0; }