linuxdvb: Add default name Position#<num> for the advanced DVB-S settings

This commit is contained in:
Jaroslav Kysela 2014-08-16 09:13:22 +02:00
parent 98f197ce6c
commit f0b348d457

View file

@ -165,6 +165,7 @@ linuxdvb_satconf_class_orbitalpos_set
linuxdvb_satconf_t *ls = p;
int c = *(int*)linuxdvb_satconf_class_orbitalpos_get(p);
int n = *(int*)v;
char buf[20];
if (n == c)
return 0;
@ -172,7 +173,11 @@ linuxdvb_satconf_class_orbitalpos_set
/* Add */
if (n > c) {
while (c < n) {
linuxdvb_satconf_ele_create0(NULL, NULL, ls);
lse = linuxdvb_satconf_ele_create0(NULL, NULL, ls);
if (lse->lse_name == NULL) {
snprintf(buf, sizeof(buf), "Position #%i", c + 1);
lse->lse_name = strdup(buf);
}
c++;
}