pud: fix intSetupNodeIdBinaryDoubleLongLong for short values
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 4 Oct 2013 08:36:41 +0000 (10:36 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 4 Oct 2013 08:46:53 +0000 (10:46 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/configuration.c

index a249e99..21f7ee9 100644 (file)
@@ -313,6 +313,12 @@ static bool intSetupNodeIdBinaryDoubleLongLong(
           (unsigned int)(node_id_len - chars1), PUD_NODE_ID_NAME, longValue2, min2, max2);
       return false;
     }
+  } else {
+    /* longvalue1 is the only value, so it is the least significant value:
+     * exchange the 2 values */
+    unsigned long long tmp = longValue1;
+    longValue1 = longValue2;
+    longValue2 = tmp;
   }
 
        return setupNodeIdBinaryDoubleLongLong(&nodeIdBinary,