diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-02 12:52:37 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-02 12:52:37 +0200 |
commit | 13b74854b37a3a0f855ee8bf723ee3d9a2c360a5 (patch) | |
tree | a9e82c8123728bb689755ded8b7ca50e79e6f5a4 /lirc.c | |
parent | c95ee7d36775c03f26489a384b3a2733d9f5c8fc (diff) | |
download | vdr-13b74854b37a3a0f855ee8bf723ee3d9a2c360a5.tar.gz vdr-13b74854b37a3a0f855ee8bf723ee3d9a2c360a5.tar.bz2 |
Made LIRC command parsing more robust
Diffstat (limited to 'lirc.c')
-rw-r--r-- | lirc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6,7 +6,7 @@ * * LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16. * - * $Id: lirc.c 1.12 2005/08/15 12:28:10 kls Exp $ + * $Id: lirc.c 1.13 2005/09/02 12:51:35 kls Exp $ */ #include "lirc.h" @@ -76,7 +76,10 @@ void cLircRemote::Action(void) if (ready && ret > 21) { int count; char KeyName[LIRC_KEY_BUF]; - sscanf(buf, "%*x %x %29s", &count, KeyName); // '29' in '%29s' is LIRC_KEY_BUF-1! + if (sscanf(buf, "%*x %x %29s", &count, KeyName) != 2) { // '29' in '%29s' is LIRC_KEY_BUF-1! + esyslog("ERROR: unparseable lirc command: %s", buf); + continue; + } if (count == 0) { if (strcmp(KeyName, LastKeyName) == 0 && FirstTime.Elapsed() < KEYPRESSDELAY) continue; // skip keys coming in too fast |