From 2fae82e1078efa1b64bd3d6a4c21cfa6197ec06d Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Mon, 8 Oct 2007 12:30:53 +0000 Subject: [PATCH] Added missing linefeeds into pid/filter statistics. --- device.c | 5 ++++- statistics.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/device.c b/device.c index 594b22d..372a247 100644 --- a/device.c +++ b/device.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.c,v 1.57 2007/10/07 22:54:09 rahrenbe Exp $ + * $Id: device.c,v 1.58 2007/10/08 12:30:53 rahrenbe Exp $ */ #include "common.h" @@ -106,6 +106,9 @@ cString cIptvDevice::GetInformation() *secfilters[i]->GetStatistic(), ((i + 1) % 2) ? '\t' : '\n'); } + // make sure it ends with linefeed + if (!endswith(*filterInfo, "\n")) + filterInfo = cString::sprintf("%s%c", *filterInfo, '\n'); // generate information string return cString::sprintf("IPTV device #%d (CardIndex: %d)\nSource: %s\n%s\n%s%s", deviceIndex, CardIndex(), pIptvStreamer ? diff --git a/statistics.c b/statistics.c index 1e2e7e5..f524c38 100644 --- a/statistics.c +++ b/statistics.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: statistics.c,v 1.11 2007/10/08 12:25:30 rahrenbe Exp $ + * $Id: statistics.c,v 1.12 2007/10/08 12:30:53 rahrenbe Exp $ */ #include @@ -88,6 +88,8 @@ cString cIptvDeviceStatistics::GetStatistic() (long)(mostActivePids[i].DataAmount / divider), unit, ((i + 1) % 2) ? '\t' : '\n'); } + if (!endswith(*info, "\n")) + info = cString::sprintf("%s%c", *info, '\n'); dataBytes = 0; memset(&mostActivePids, '\0', sizeof(mostActivePids)); return info;