Fixed ConditionalAddTextStringToMap
authorErich Keane <erich.keane@intel.com>
Fri, 14 Aug 2015 20:07:00 +0000 (13:07 -0700)
committerErich Keane <erich.keane@intel.com>
Fri, 14 Aug 2015 21:11:36 +0000 (21:11 +0000)
Refactoring changes the function to return an error in the 'null'
condition rather than remain a valid value.  This patch returns it to
its previous behavior by having it return 0

Change-Id: I7a3b42399dec2df3955f2b4ef513fa0ca7433bb8
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2212
Reviewed-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: Omkar Hegde <omkar.m.hegde@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/stack/src/ocpayloadconvert.c

index 7c8db38..a95c618 100644 (file)
@@ -700,5 +700,5 @@ static int64_t AddTextStringToMap(CborEncoder* map, const char* key, size_t keyl
 static int64_t ConditionalAddTextStringToMap(CborEncoder* map, const char* key, size_t keylen,
         const char* value)
 {
-    return value ? AddTextStringToMap(map, key, keylen, value) : 0 - OC_STACK_INVALID_PARAM;
+    return value ? AddTextStringToMap(map, key, keylen, value) : 0;
 }