fixed: #10088 - inputlirc pakets wont be recognized, thanks to trackel.
authorjmarshallnz <jmarshallnz@svn>
Sat, 18 Sep 2010 21:25:59 +0000 (21:25 +0000)
committerjmarshallnz <jmarshallnz@svn>
Sat, 18 Sep 2010 21:25:59 +0000 (21:25 +0000)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@33958 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

guilib/common/LIRC.cpp

index 038634b..973c542 100644 (file)
@@ -278,8 +278,11 @@ void CRemoteControl::Update()
 
     m_button = CButtonTranslator::GetInstance().TranslateLircRemoteString(deviceName, buttonName);
 
-    int repeat = atol(repeatStr);
-    if (strcmp(repeatStr, "00") == 0)
+    char *end = NULL;
+    long repeat = strtol(repeatStr, &end, 10);
+    if (!end || *end != 0)
+      CLog::Log(LOGERROR, "LIRC: invalid non-numeric character in expression %s", repeatStr);
+    if (repeat == 0)
     {
       CLog::Log(LOGDEBUG, "LIRC: %s - NEW at %d:%s (%s)", __FUNCTION__, now, m_buf, buttonName);
       m_firstClickTime = now;