Fixed trailing-comma in too-long JSON discovery packet
authorErich Keane <erich.keane@intel.com>
Fri, 29 May 2015 22:21:27 +0000 (15:21 -0700)
committerErich Keane <erich.keane@intel.com>
Mon, 1 Jun 2015 16:40:36 +0000 (16:40 +0000)
The logic for removing the trailing comma in the event that a resource
was improperly added was reversed.  This removes the "NOT" to correct
this so that the comma is only removed in the event that it was actually
added.

Change-Id: I4f6037198ef7a67cd3d83d77f5e27aebb7cc0b28
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1155
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/stack/src/ocresource.c

index 976925b..435bb9f 100644 (file)
@@ -734,7 +734,7 @@ HandleVirtualResource (OCServerRequest *request, OCResource* resource)
                     if (result != OC_STACK_OK)
                     {
                         // if this failed, we need to remove the comma added above.
-                        if(!firstLoopDone)
+                        if(firstLoopDone)
                         {
                             ptr--;
                             *ptr = '\0';