Fix compilation issue in security module
authorHabib Virji <habib.virji@samsung.com>
Mon, 12 Oct 2015 15:43:13 +0000 (16:43 +0100)
committerHabib Virji <habib.virji@samsung.com>
Thu, 15 Oct 2015 21:55:46 +0000 (21:55 +0000)
Fixed types used for OIC_LOG_V were not correct.
Fixed tmp variables used under the flag to be declared under the flag.

Change-Id: I78a38d7fa89d56b7c350b2144c9916e55dff9c10
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3819
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
resource/csdk/security/src/doxmresource.c
resource/csdk/security/src/psinterface.c

index cb2bd37..6acb7e3 100644 (file)
@@ -596,9 +596,11 @@ static OCEntityHandlerResult HandleDoxmPutRequest (const OCEntityHandlerRequest
         }
         else if(OIC_RANDOM_DEVICE_PIN == newDoxm->oxmSel)
         {
+#ifdef __WITH_DTLS__
             //this temp Credential ID is used to track temporal Cred Id
             static OicUuid_t tmpCredId = {.id={0}};
             static bool tmpCredGenFlag = false;
+#endif //__WITH_DTLS__
 
             if ((false == gDoxm->owned) && (false == newDoxm->owned))
             {
index 992fe70..391c62f 100644 (file)
@@ -96,7 +96,7 @@ char * GetSVRDatabase()
             size_t bytesRead = ps->read(jsonStr, 1, size, fp);
             jsonStr[bytesRead] = '\0';
 
-            OC_LOG_V(DEBUG, TAG, "Read %d bytes from SVR database file", bytesRead);
+            OC_LOG_V(DEBUG, TAG, "Read %zu bytes from SVR database file", bytesRead);
             ps->close(fp);
             fp = NULL;
         }
@@ -190,7 +190,7 @@ OCStackResult UpdateSVRDatabase(const char* rsrcName, cJSON* jsonObj)
             {
                 ret = OC_STACK_OK;
             }
-            OC_LOG_V(DEBUG, TAG, "Written %d bytes into SVR database file", bytesWritten);
+            OC_LOG_V(DEBUG, TAG, "Written %zu bytes into SVR database file", bytesWritten);
             ps->close(fp);
             fp = NULL;
         }