chan_dect: fix codec-list parsing
Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
438e90d735
commit
7f95e315e4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue