Fixed format string handling

This commit is contained in:
Klaus Schmidinger
2006-03-26 09:27:30 +02:00
parent 8a3dae1e8b
commit 1fe46dfa9f
11 changed files with 51 additions and 46 deletions

View File

@@ -41,3 +41,7 @@ VDR Plugin 'sky' Revision History
2005-09-17: Version 0.3.4
- Added a missing include statement.
2006-03-26: Version 0.3.5
- Fixed format string handling.

View File

@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: sky.c 1.12 2005/09/17 10:39:35 kls Exp $
* $Id: sky.c 1.13 2006/03/26 09:21:10 kls Exp $
*/
#include <sys/socket.h>
@@ -15,7 +15,7 @@
#include <vdr/plugin.h>
#include <vdr/sources.h>
static const char *VERSION = "0.3.4";
static const char *VERSION = "0.3.5";
static const char *DESCRIPTION = "Sky Digibox interface";
// --- cDigiboxDevice --------------------------------------------------------
@@ -108,9 +108,8 @@ cDigiboxDevice::~cDigiboxDevice()
void cDigiboxDevice::LircSend(const char *s)
{
const char *c = "SEND_ONCE SKY %s\n";
char buf[100];
sprintf(buf, c, s);
snprintf(buf, sizeof(buf), "SEND_ONCE SKY %s\n", s);
dsyslog(buf);//XXX
if (write(fd_lirc, buf, strlen(buf)) < 0)
LOG_ERROR;//XXX _STR