summaryrefslogtreecommitdiff
path: root/lcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcd.c')
-rw-r--r--lcd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lcd.c b/lcd.c
index 4229166..6c8151e 100644
--- a/lcd.c
+++ b/lcd.c
@@ -67,7 +67,10 @@ cLcd::~cLcd() {
}
bool cLcd::Connect( const char *host, unsigned int port ) {
- asprintf(&(this->host), "%s", host);
+ if (asprintf(&(this->host), "%s", host) < 0) {
+ syslog(LOG_ERR, "lcdproc: error allocating memory in asprintf");
+ return false;
+ }
this->port = port;
cLcd::Open();
@@ -912,7 +915,7 @@ void cLcd::Action(void) { // LCD output thread
if ( (now.tv_usec < WakeUpCycle) && (replayDvbApi) ) {
char tempbuffer[16];
replayDvbApi->GetIndex(Current, Total, false); Total=(Total==0)?1:Total;
- sprintf(tempbuffer,IndexToHMSF(Total));
+ sprintf(tempbuffer,"%s",(const char*)IndexToHMSF(Total));
SetProgress(IndexToHMSF(Current),tempbuffer, (100 * Current) / Total);
}