From 0d9c89555a1859cd59553bef122a8de383342457 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Fri, 29 May 2015 15:21:27 -0700 Subject: [PATCH] Fixed trailing-comma in too-long JSON discovery packet 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/1155 Tested-by: jenkins-iotivity --- resource/csdk/stack/src/ocresource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/csdk/stack/src/ocresource.c b/resource/csdk/stack/src/ocresource.c index 976925b..435bb9f 100644 --- a/resource/csdk/stack/src/ocresource.c +++ b/resource/csdk/stack/src/ocresource.c @@ -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'; -- 2.7.4