pud: specify where to store the result in intSetupNodeIdBinaryDoubleLongLong
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 4 Oct 2013 08:02:51 +0000 (10:02 +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 7d5b83c..a249e99 100644 (file)
@@ -266,6 +266,7 @@ static bool intSetupNodeIdBinaryLongLong(unsigned long long min,
  - false on failure
  */
 static bool intSetupNodeIdBinaryDoubleLongLong(
+    unsigned char * dst,
     unsigned int chars1,
     unsigned long long min1, unsigned long long max1,
     unsigned int bytes1,
@@ -315,8 +316,8 @@ static bool intSetupNodeIdBinaryDoubleLongLong(
   }
 
        return setupNodeIdBinaryDoubleLongLong(&nodeIdBinary,
-           longValue1, (unsigned char *)&nodeIdBinary.buffer.mip[0], bytes1,
-           longValue2, (unsigned char *)&nodeIdBinary.buffer.mip[bytes1], bytes2);
+           longValue1, &dst[0], bytes1,
+           longValue2, &dst[bytes1], bytes2);
 }
 
 /**
@@ -405,6 +406,7 @@ static bool setupNodeIdBinaryAndValidate(NodeIdType nodeIdTypeNumber) {
 
                case PUD_NODEIDTYPE_MIP: /* a MIP OID number */
                        return intSetupNodeIdBinaryDoubleLongLong(
+                           &nodeIdBinary.buffer.mip[0],
                            PUD_NODEIDTYPE_MIP_CHARS1,
                            PUD_NODEIDTYPE_MIP_MIN1, PUD_NODEIDTYPE_MIP_MAX1,
                            PUD_NODEIDTYPE_MIP_BYTES1,