diseqc errors

Message ID 4DD917B8.105@needful.de
State New
Headers

Commit Message

Marco Göbenich May 22, 2011, 2:03 p.m. UTC
  Hi!

Thanks, I will test this patch.

One note, there was a missing {

+                 if (parsing) {

Attached a newer version of the patch.

Regards

Marco

Am 22.05.2011 13:43, schrieb Klaus Schmidinger:
> if (parsing)
  

Comments

Klaus Schmidinger May 22, 2011, 2:06 p.m. UTC | #1
On 22.05.2011 16:03, Marco Göbenich wrote:
> Hi!
>
> Thanks, I will test this patch.
>
> One note, there was a missing {
>
> + if (parsing) {

I just quickly hacked that one together, without actually testing it ;-)

Klaus
  

Patch

--- diseqc.c	2008/02/10 14:09:27	1.6
+++ diseqc.c	2011/05/22 11:41:05
@@ -73,15 +73,18 @@ 
 {
   char *e = strchr(s, ']');
   if (e) {
-     numCodes = 0;
+     int NumCodes = 0;
      char *t = s;
      char *p = s;
      while (t < e) {
-           if (numCodes < MaxDiseqcCodes) {
+           if (NumCodes < MaxDiseqcCodes) {
               errno = 0;
               int n = strtol(t, &p, 16);
               if (!errno && p != t && 0 <= n && n <= 255) {
-                 codes[numCodes++] = n;
+                 if (parsing) {
+                    codes[NumCodes++] = n;
+                    numCodes = NumCodes;
+                    }
                  t = skipspace(p);
                  }
               else {