Commit cba0de12 authored by George Nash's avatar George Nash Committed by Nathan Heldt-Sheller

IOT-2539 Cleanup -Wformat= warnings

The -Wformat= warning is given when the conversion specifier
in a printf or scanf command does not match the value actually
passed in.

In this commit all of the issues are found in LOG functions.
If type passed in was a variable size parameter like a pointer or
size_t. The the PRIuPTR value from the inttypes.h
header is used. For ssize_t variables the PRIdPTR was used.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I4977253ac7ee68d2e80a26a0963b770b2ce87032
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21771Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 60d89aa8
)
parent 79ba615e
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include <assert.h> #include <assert.h>
#include <inttypes.h>
#include "ca_adapter_net_ssl.h" #include "ca_adapter_net_ssl.h"
#include "cacommon.h" #include "cacommon.h"
#include "caipinterface.h" #include "caipinterface.h"
...@@ -588,7 +589,7 @@ static int SendCallBack(void * tep, const unsigned char * data, size_t dataLen) ...@@ -588,7 +589,7 @@ static int SendCallBack(void * tep, const unsigned char * data, size_t dataLen)
else if ((size_t)sentLen != dataLen) else if ((size_t)sentLen != dataLen)
{ {
OIC_LOG_V(DEBUG, NET_SSL_TAG, OIC_LOG_V(DEBUG, NET_SSL_TAG,
"Packet was partially sent - sent/total/remained bytes : %d/%" PRIuPTR "/%" PRIuPTR, "Packet was partially sent - sent/total/remained bytes : %" PRIdPTR "/%" PRIuPTR "/%" PRIuPTR,
sentLen, dataLen, (dataLen - sentLen)); sentLen, dataLen, (dataLen - sentLen));
} }
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "oic_string.h" #include "oic_string.h"
#include "oic_malloc.h" #include "oic_malloc.h"
#include <errno.h> #include <errno.h>
#include <inttypes.h>
#ifdef HAVE_WS2TCPIP_H #ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h> #include <ws2tcpip.h>
...@@ -387,7 +388,7 @@ void CALogSendStateInfo(CATransportAdapter_t adapter, ...@@ -387,7 +388,7 @@ void CALogSendStateInfo(CATransportAdapter_t adapter,
if (true == isSuccess) if (true == isSuccess)
{ {
OIC_LOG_V(DEBUG, ANALYZER_TAG, "Send Success, sent length = [%d]", sentLen); OIC_LOG_V(DEBUG, ANALYZER_TAG, "Send Success, sent length = [%" PRIdPTR "]", sentLen);
} }
else else
{ {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h>
#include "cafragmentation.h" #include "cafragmentation.h"
...@@ -1367,7 +1368,7 @@ static void CALEServerSendDataThread(void *threadData) ...@@ -1367,7 +1368,7 @@ static void CALEServerSendDataThread(void *threadData)
OIC_LOG_V(DEBUG, OIC_LOG_V(DEBUG,
CALEADAPTER_TAG, CALEADAPTER_TAG,
"Server Sent Unicast First Data - data length [%zu]", "Server Sent Unicast First Data - data length [%u]",
length); length);
result = CAGenerateHeader(dataHeader, result = CAGenerateHeader(dataHeader,
...@@ -1780,7 +1781,7 @@ static void CALEClientSendDataThread(void *threadData) ...@@ -1780,7 +1781,7 @@ static void CALEClientSendDataThread(void *threadData)
} }
OIC_LOG_V(DEBUG, OIC_LOG_V(DEBUG,
CALEADAPTER_TAG, CALEADAPTER_TAG,
"Client Sent Unicast First Data - data length [%zu]", "Client Sent Unicast First Data - data length [%u]",
length); length);
result = CAGenerateHeader(dataHeader, result = CAGenerateHeader(dataHeader,
...@@ -1842,7 +1843,7 @@ static void CALEClientSendDataThread(void *threadData) ...@@ -1842,7 +1843,7 @@ static void CALEClientSendDataThread(void *threadData)
} }
OIC_LOG_V(DEBUG, OIC_LOG_V(DEBUG,
CALEADAPTER_TAG, CALEADAPTER_TAG,
"Client Sent Unicast %d Data - data(mtu) length [%zu]", "Client Sent Unicast %d Data - data(mtu) length [%u]",
index + 1, index + 1,
g_mtuSize); g_mtuSize);
} }
...@@ -2827,7 +2828,7 @@ static ssize_t CALESecureSendDataCB(CAEndpoint_t *endpoint, ...@@ -2827,7 +2828,7 @@ static ssize_t CALESecureSendDataCB(CAEndpoint_t *endpoint,
VERIFY_NON_NULL_RET(endpoint, CALEADAPTER_TAG, "endpoint is NULL", -1); VERIFY_NON_NULL_RET(endpoint, CALEADAPTER_TAG, "endpoint is NULL", -1);
VERIFY_NON_NULL_RET(data, CALEADAPTER_TAG, "data is NULL", -1); VERIFY_NON_NULL_RET(data, CALEADAPTER_TAG, "data is NULL", -1);
OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Secure Data Send - encrypted datalen = %d", dataLen); OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Secure Data Send - encrypted datalen = %" PRIuPTR, dataLen);
CAResult_t result; CAResult_t result;
CADataType_t dataType = g_dataType; CADataType_t dataType = g_dataType;
...@@ -2881,7 +2882,7 @@ static void CALESecureReceiveDataCB(const CASecureEndpoint_t *sep, ...@@ -2881,7 +2882,7 @@ static void CALESecureReceiveDataCB(const CASecureEndpoint_t *sep,
VERIFY_NON_NULL_VOID(sep, CALEADAPTER_TAG, "sep is NULL"); VERIFY_NON_NULL_VOID(sep, CALEADAPTER_TAG, "sep is NULL");
VERIFY_NON_NULL_VOID(data, CALEADAPTER_TAG, "data is NULL"); VERIFY_NON_NULL_VOID(data, CALEADAPTER_TAG, "data is NULL");
OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Secure Data Receive - decrypted datalen = %d", dataLen); OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Secure Data Receive - decrypted datalen = %" PRIuPTR, dataLen);
if (dataLen == 0) if (dataLen == 0)
{ {
...@@ -3782,7 +3783,7 @@ static CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress, ...@@ -3782,7 +3783,7 @@ static CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress,
// Create bleData to add to queue // Create bleData to add to queue
OIC_LOG_V(DEBUG, OIC_LOG_V(DEBUG,
CALEADAPTER_TAG, CALEADAPTER_TAG,
"Data received from LE Client layer [%zu]", "Data received from LE Client layer [%u]",
dataLength); dataLength);
CALEData_t * const bleData = CALEData_t * const bleData =
......
...@@ -471,7 +471,7 @@ CAResult_t CAGetNetworkInfo(CAEndpoint_t **info, size_t *size) ...@@ -471,7 +471,7 @@ CAResult_t CAGetNetworkInfo(CAEndpoint_t **info, size_t *size)
OIC_LOG_V(DEBUG, OIC_LOG_V(DEBUG,
TAG, TAG,
"%" PRIu32 " adapter network info size is %" PRIu32 " res:%d", "%" PRIuPTR " adapter network info size is %" PRIuPTR " res:%u",
index, index,
tempSize[index], tempSize[index],
res); res);
...@@ -864,4 +864,3 @@ CAResult_t CAReadData() ...@@ -864,4 +864,3 @@ CAResult_t CAReadData()
return CA_STATUS_OK; return CA_STATUS_OK;
} }
#endif #endif
...@@ -1469,7 +1469,7 @@ static void CALogPDUInfo(const CAData_t *data, const coap_pdu_t *pdu) ...@@ -1469,7 +1469,7 @@ static void CALogPDUInfo(const CAData_t *data, const coap_pdu_t *pdu)
if (pdu->transport_hdr) if (pdu->transport_hdr)
{ {
OIC_LOG_V(DEBUG, ANALYZER_TAG, "Msg ID = [%u]", OIC_LOG_V(DEBUG, ANALYZER_TAG, "Msg ID = [%u]",
(uint32_t)ntohs(pdu->transport_hdr->udp.id)); (uint32_t)ntohs(pdu->transport_hdr->udp.id));
} }
...@@ -1499,7 +1499,7 @@ static void CALogPDUInfo(const CAData_t *data, const coap_pdu_t *pdu) ...@@ -1499,7 +1499,7 @@ static void CALogPDUInfo(const CAData_t *data, const coap_pdu_t *pdu)
#ifdef TB_LOG #ifdef TB_LOG
size_t payloadLen = (pdu->data) ? (unsigned char *)pdu->hdr + pdu->length - pdu->data : 0; size_t payloadLen = (pdu->data) ? (unsigned char *)pdu->hdr + pdu->length - pdu->data : 0;
#endif #endif
OIC_LOG_V(DEBUG, ANALYZER_TAG, "CoAP Message Full Size = [%lu]", pdu->length); OIC_LOG_V(DEBUG, ANALYZER_TAG, "CoAP Message Full Size = [%u]", pdu->length);
OIC_LOG(DEBUG, ANALYZER_TAG, "CoAP Header (+ 0xFF)"); OIC_LOG(DEBUG, ANALYZER_TAG, "CoAP Header (+ 0xFF)");
OIC_LOG_BUFFER(DEBUG, ANALYZER_TAG, (const uint8_t *) pdu->transport_hdr, OIC_LOG_BUFFER(DEBUG, ANALYZER_TAG, (const uint8_t *) pdu->transport_hdr,
pdu->length - payloadLen); pdu->length - payloadLen);
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#endif #endif
#include <coap/pdu.h> #include <coap/pdu.h>
#include <inttypes.h>
#include "caipinterface.h" #include "caipinterface.h"
#include "caipnwmonitor.h" #include "caipnwmonitor.h"
#include "caadapterutils.h" #include "caadapterutils.h"
...@@ -1197,7 +1198,7 @@ CAResult_t CAIPStartListenServer() ...@@ -1197,7 +1198,7 @@ CAResult_t CAIPStartListenServer()
} }
size_t len = u_arraylist_length(iflist); size_t len = u_arraylist_length(iflist);
OIC_LOG_V(DEBUG, TAG, "IP network interfaces found: %d", len); OIC_LOG_V(DEBUG, TAG, "IP network interfaces found: %" PRIuPTR, len);
for (size_t i = 0; i < len; i++) for (size_t i = 0; i < len; i++)
{ {
...@@ -1238,7 +1239,7 @@ CAResult_t CAIPStopListenServer() ...@@ -1238,7 +1239,7 @@ CAResult_t CAIPStopListenServer()
} }
size_t len = u_arraylist_length(iflist); size_t len = u_arraylist_length(iflist);
OIC_LOG_V(DEBUG, TAG, "IP network interfaces found: %d", len); OIC_LOG_V(DEBUG, TAG, "IP network interfaces found: %" PRIuPTR, len);
for (size_t i = 0; i < len; i++) for (size_t i = 0; i < len; i++)
{ {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h>
#ifndef __STDC_FORMAT_MACROS #ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
...@@ -211,7 +212,7 @@ void CATCPPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data, ...@@ -211,7 +212,7 @@ void CATCPPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data,
} }
else else
{ {
OIC_LOG_V(DEBUG, TAG, "%u bytes required for complete CoAP", OIC_LOG_V(DEBUG, TAG, "%" PRIuPTR " bytes required for complete CoAP",
svritem->totalLen - svritem->len); svritem->totalLen - svritem->len);
} }
} }
...@@ -230,7 +231,7 @@ static ssize_t CATCPPacketSendCB(CAEndpoint_t *endpoint, const void *data, size_ ...@@ -230,7 +231,7 @@ static ssize_t CATCPPacketSendCB(CAEndpoint_t *endpoint, const void *data, size_
ssize_t ret = CATCPSendData(endpoint, data, dataLength); ssize_t ret = CATCPSendData(endpoint, data, dataLength);
OIC_LOG_V(DEBUG, TAG, "Out %s : %d bytes sent", __func__, ret); OIC_LOG_V(DEBUG, TAG, "Out %s : %" PRIdPTR " bytes sent", __func__, ret);
return ret; return ret;
} }
#endif #endif
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#include <coap/pdu.h> #include <coap/pdu.h>
#include <coap/utlist.h> #include <coap/utlist.h>
#include <inttypes.h>
#ifdef __WITH_TLS__ #ifdef __WITH_TLS__
#include "ca_adapter_net_ssl.h" #include "ca_adapter_net_ssl.h"
...@@ -647,7 +648,7 @@ CAResult_t CAConstructCoAP(CATCPSessionInfo_t *svritem, unsigned char **data, ...@@ -647,7 +648,7 @@ CAResult_t CAConstructCoAP(CATCPSessionInfo_t *svritem, unsigned char **data,
unsigned char *inBuffer = *data; unsigned char *inBuffer = *data;
size_t inLen = *dataLength; size_t inLen = *dataLength;
OIC_LOG_V(DEBUG, TAG, "before-datalength : %u", *dataLength); OIC_LOG_V(DEBUG, TAG, "before-datalength : %" PRIuPTR, *dataLength);
if (NULL == svritem->data && inLen > 0) if (NULL == svritem->data && inLen > 0)
{ {
...@@ -737,7 +738,7 @@ CAResult_t CAConstructCoAP(CATCPSessionInfo_t *svritem, unsigned char **data, ...@@ -737,7 +738,7 @@ CAResult_t CAConstructCoAP(CATCPSessionInfo_t *svritem, unsigned char **data,
*data = inBuffer; *data = inBuffer;
*dataLength = inLen; *dataLength = inLen;
OIC_LOG_V(DEBUG, TAG, "after-datalength : %u", *dataLength); OIC_LOG_V(DEBUG, TAG, "after-datalength : %" PRIuPTR, *dataLength);
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__); OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
return CA_STATUS_OK; return CA_STATUS_OK;
} }
...@@ -766,10 +767,10 @@ static CAResult_t CAReceiveMessage(CATCPSessionInfo_t *svritem) ...@@ -766,10 +767,10 @@ static CAResult_t CAReceiveMessage(CATCPSessionInfo_t *svritem)
//[3][4] bytes in tls header are tls payload length //[3][4] bytes in tls header are tls payload length
tlsLength = TLS_HEADER_SIZE + tlsLength = TLS_HEADER_SIZE +
(size_t)((svritem->tlsdata[3] << 8) | svritem->tlsdata[4]); (size_t)((svritem->tlsdata[3] << 8) | svritem->tlsdata[4]);
OIC_LOG_V(DEBUG, TAG, "toal tls length = %u", tlsLength); OIC_LOG_V(DEBUG, TAG, "total tls length = %" PRIuPTR, tlsLength);
if (tlsLength > sizeof(svritem->tlsdata)) if (tlsLength > sizeof(svritem->tlsdata))
{ {
OIC_LOG_V(ERROR, TAG, "toal tls length is too big (buffer size : %u)", OIC_LOG_V(ERROR, TAG, "total tls length is too big (buffer size : %" PRIuPTR ")",
sizeof(svritem->tlsdata)); sizeof(svritem->tlsdata));
return CA_RECEIVE_FAILED; return CA_RECEIVE_FAILED;
} }
...@@ -790,7 +791,7 @@ static CAResult_t CAReceiveMessage(CATCPSessionInfo_t *svritem) ...@@ -790,7 +791,7 @@ static CAResult_t CAReceiveMessage(CATCPSessionInfo_t *svritem)
else else
{ {
svritem->tlsLen += len; svritem->tlsLen += len;
OIC_LOG_V(DEBUG, TAG, "nb_read : %u bytes , recv() : %d bytes, svritem->tlsLen : %u bytes", OIC_LOG_V(DEBUG, TAG, "nb_read : %" PRIuPTR " bytes , recv() : %d bytes, svritem->tlsLen : %" PRIuPTR " bytes",
nbRead, len, svritem->tlsLen); nbRead, len, svritem->tlsLen);
if (tlsLength > 0 && tlsLength == svritem->tlsLen) if (tlsLength > 0 && tlsLength == svritem->tlsLen)
{ {
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <inttypes.h>
#include "oic_malloc.h" #include "oic_malloc.h"
#include "oic_string.h" #include "oic_string.h"
#include "cacommon.h" #include "cacommon.h"
...@@ -100,7 +101,7 @@ OCStackResult OC_CALL OCGenerateRandomSerialNumber(char **serial, size_t *serial ...@@ -100,7 +101,7 @@ OCStackResult OC_CALL OCGenerateRandomSerialNumber(char **serial, size_t *serial
VERIFY_SUCCESS(TAG, OCGetRandomBytes(random, sizeof(random)), ERROR); VERIFY_SUCCESS(TAG, OCGetRandomBytes(random, sizeof(random)), ERROR);
/* Per RFC 5280, 20 octets is the maximum length of a serial number. In ASN.1, if the highest-order /* Per RFC 5280, 20 octets is the maximum length of a serial number. In ASN.1, if the highest-order
* bit is set it causes a padding octet to be written, which would be 21 and non-compliant. * bit is set it causes a padding octet to be written, which would be 21 and non-compliant.
* Therefore, always clear the highest-order bit. Integers in ASN.1 are always big-Endian. * Therefore, always clear the highest-order bit. Integers in ASN.1 are always big-Endian.
*/ */
random[0] &= 0x7F; random[0] &= 0x7F;
...@@ -324,7 +325,7 @@ static OCStackResult GenerateCertificate( ...@@ -324,7 +325,7 @@ static OCStackResult GenerateCertificate(
{ {
ret = mbedtls_x509write_crt_set_basic_constraints(&outCertCtx, 1, -1); ret = mbedtls_x509write_crt_set_basic_constraints(&outCertCtx, 1, -1);
VERIFY_SUCCESS(TAG, 0 == ret, ERROR); VERIFY_SUCCESS(TAG, 0 == ret, ERROR);
ret = mbedtls_x509write_crt_set_key_usage(&outCertCtx, ret = mbedtls_x509write_crt_set_key_usage(&outCertCtx,
MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN); MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN);
VERIFY_SUCCESS(TAG, 0 == ret, ERROR); VERIFY_SUCCESS(TAG, 0 == ret, ERROR);
} }
...@@ -339,7 +340,7 @@ static OCStackResult GenerateCertificate( ...@@ -339,7 +340,7 @@ static OCStackResult GenerateCertificate(
MBEDTLS_X509_KU_KEY_AGREEMENT); MBEDTLS_X509_KU_KEY_AGREEMENT);
VERIFY_SUCCESS(TAG, 0 == ret, ERROR); VERIFY_SUCCESS(TAG, 0 == ret, ERROR);
} }
switch (certType) switch (certType)
{ {
case CERT_TYPE_ROLE: case CERT_TYPE_ROLE:
...@@ -426,7 +427,7 @@ OCStackResult OC_CALL OCGenerateCACertificate( ...@@ -426,7 +427,7 @@ OCStackResult OC_CALL OCGenerateCACertificate(
{ {
OCStackResult res = OC_STACK_OK; OCStackResult res = OC_STACK_OK;
OCByteString byteStr = { 0 }; OCByteString byteStr = { 0 };
res = GenerateCertificate( res = GenerateCertificate(
CERT_TYPE_CA, CERT_TYPE_CA,
subject, subject,
...@@ -677,7 +678,7 @@ OCStackResult OC_CALL OCGetUuidFromCSR(const char* csr, OicUuid_t* uuid) ...@@ -677,7 +678,7 @@ OCStackResult OC_CALL OCGetUuidFromCSR(const char* csr, OicUuid_t* uuid)
ret = mbedtls_x509_dn_gets(uuidStr, sizeof(uuidStr), &csrObj.subject); ret = mbedtls_x509_dn_gets(uuidStr, sizeof(uuidStr), &csrObj.subject);
if (ret != (sizeof(uuidStr) - 1)) if (ret != (sizeof(uuidStr) - 1))
{ {
OIC_LOG_V(ERROR, TAG, "mbedtls_x509_dn_gets returned length or error: %d, expected %d", ret, sizeof(uuidStr) - 1); OIC_LOG_V(ERROR, TAG, "mbedtls_x509_dn_gets returned length or error: %d, expected %" PRIuPTR, ret, sizeof(uuidStr) - 1);
mbedtls_x509_csr_free(&csrObj); mbedtls_x509_csr_free(&csrObj);
return OC_STACK_ERROR; return OC_STACK_ERROR;
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "ocstack.h" #include "ocstack.h"
#include "oic_malloc.h" #include "oic_malloc.h"
...@@ -208,7 +209,7 @@ OCStackResult PstatToCBORPayloadPartial(const OicSecPstat_t *pstat, ...@@ -208,7 +209,7 @@ OCStackResult PstatToCBORPayloadPartial(const OicSecPstat_t *pstat,
pstatMapSize++; pstatMapSize++;
} }
} }
OIC_LOG_V(INFO, TAG, "%s: creating pstat CBOR payload with %zu Properties.", OIC_LOG_V(INFO, TAG, "%s: creating pstat CBOR payload with %" PRIuPTR " Properties.",
__func__, pstatMapSize - PSTAT_EMPTY_MAP_SIZE); __func__, pstatMapSize - PSTAT_EMPTY_MAP_SIZE);
// Top Level Pstat Map // Top Level Pstat Map
...@@ -1263,4 +1264,3 @@ exit: ...@@ -1263,4 +1264,3 @@ exit:
OICFree(cborPayload); OICFree(cborPayload);
return ret; return ret;
} }
...@@ -716,7 +716,7 @@ OCStackResult CBORPayloadToRoles(const uint8_t *cborPayload, size_t size, RoleCe ...@@ -716,7 +716,7 @@ OCStackResult CBORPayloadToRoles(const uint8_t *cborPayload, size_t size, RoleCe
/* Only SIGNED_ASYMMETRIC_KEY is supported. */ /* Only SIGNED_ASYMMETRIC_KEY is supported. */
if (SIGNED_ASYMMETRIC_KEY != (OicSecCredType_t)credType) if (SIGNED_ASYMMETRIC_KEY != (OicSecCredType_t)credType)
{ {
OIC_LOG_V(ERROR, TAG, "Unsupported role credential type: %llu", credType); OIC_LOG_V(ERROR, TAG, "Unsupported role credential type: %lu", credType);
goto exit; goto exit;
} }
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h>
#include "iotivity_config.h" #include "iotivity_config.h"
#include "CoapHttpParser.h" #include "CoapHttpParser.h"
...@@ -552,7 +553,7 @@ static size_t CHPEasyHandleWriteCb(char *buffer, size_t size, size_t num, void * ...@@ -552,7 +553,7 @@ static size_t CHPEasyHandleWriteCb(char *buffer, size_t size, size_t num, void *
void *newPayload = OICRealloc(resp->payload, ctx->writeOffset + dataToWrite); void *newPayload = OICRealloc(resp->payload, ctx->writeOffset + dataToWrite);
if (!newPayload) if (!newPayload)
{ {
OIC_LOG_V(ERROR, TAG, "Realloc failed! Current: %u Extra: %u", ctx->writeOffset, OIC_LOG_V(ERROR, TAG, "Realloc failed! Current: %" PRIuPTR " Extra: %" PRIuPTR, ctx->writeOffset,
dataToWrite); dataToWrite);
resp->payloadLength = 0; resp->payloadLength = 0;
ctx->writeOffset = 0; ctx->writeOffset = 0;
...@@ -567,7 +568,7 @@ static size_t CHPEasyHandleWriteCb(char *buffer, size_t size, size_t num, void * ...@@ -567,7 +568,7 @@ static size_t CHPEasyHandleWriteCb(char *buffer, size_t size, size_t num, void *
ctx->writeOffset += dataToWrite; ctx->writeOffset += dataToWrite;
resp->payloadLength = ctx->writeOffset; resp->payloadLength = ctx->writeOffset;
OIC_LOG_V(DEBUG, TAG, "%s OUT %u : %u", __func__, resp->payloadLength, dataToWrite); OIC_LOG_V(DEBUG, TAG, "%s OUT %" PRIuPTR " : %" PRIuPTR, __func__, resp->payloadLength, dataToWrite);
return dataToWrite; return dataToWrite;
} }
...@@ -867,4 +868,3 @@ OCStackResult CHPPostHttpRequest(HttpRequest_t *req, CHPResponseCallback httpcb, ...@@ -867,4 +868,3 @@ OCStackResult CHPPostHttpRequest(HttpRequest_t *req, CHPResponseCallback httpcb,
OIC_LOG_V(DEBUG, TAG, "%s OUT", __func__); OIC_LOG_V(DEBUG, TAG, "%s OUT", __func__);
return OC_STACK_OK; return OC_STACK_OK;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment