aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-14 13:18:26 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-14 13:21:14 -0300
commit22d2e4a3269798fd4e4c5800ab2fe070c2d35c8b (patch)
tree6e5c2c7e0c07e5cba36ca22f4ddfc3533b792865
parentd3558a8a8e8187c4485ca20a3ba187e58f64bff1 (diff)
libdvbv5: Re-add the status name at the stats report
Changeset d3558a8a8e made the status to disappear. The main issue that it were trying to fix is that the len were calculated wrong, but the reason is because len is a pointer, so it should have been incremented as a pointer, with: *len += size This patch fix it properly, and make the status name to reappear. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--lib/libdvbv5/dvb-fe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
index af724dd0..c480bdca 100644
--- a/lib/libdvbv5/dvb-fe.c
+++ b/lib/libdvbv5/dvb-fe.c
@@ -1443,19 +1443,21 @@ int dvb_fe_snprintf_stat(struct dvb_v5_fe_parms *p, uint32_t cmd,
for (i = ARRAY_SIZE(sig_bits) - 1; i >= 0 ; i--) {
if ((1 << i) & status) {
size = snprintf(*buf, *len, "%-7s", sig_bits[i]);
+ *buf += size;
+ *len -= size;
break;
}
}
if (i < 0) {
size = snprintf(*buf, *len, "%7s", "");
*buf += size;
- len -= size;
+ *len -= size;
}
/* Add the status bits */
size = snprintf(*buf, *len, "(0x%02x)", status);
*buf += size;
- len -= size;
+ *len -= size;
return initial_len - *len;
}

Privacy Policy