Commit e5c1ce10 authored by Oleksandr Dmytrenko's avatar Oleksandr Dmytrenko Committed by Aleksey

ocpayloadparse fixed

1)error: ISO C++ forbids converting a string constant to 'char*'
2)_POSIX_C_SOURCE redefined(/usr/include/features.h:
        this is the location of the previous definition)

Change-Id: I69edcddf46766cb948deb7c169f2ac727656055f
Signed-off-by: default avatarOleksandr Dmytrenko <>
parent a29612e9
......@@ -25,6 +25,9 @@
// For POSIX.1-2001 base specification,
// Refer
// Required for strok_r
#if defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200112L
#include <string.h>
......@@ -132,7 +135,7 @@ static char* InPlaceStringTrim(char* str)
return str;
static CborError OCParseStringLL(CborValue *map, char *type, OCStringLL **resource)
static CborError OCParseStringLL(CborValue *map, const char *type, OCStringLL **resource)
CborValue val;
CborError err = cbor_value_map_find_value(map, type, &val);
......@@ -552,7 +555,7 @@ static CborError ParseResources(OCDiscoveryPayload **outPayload, CborValue *reso
err = cbor_value_advance(resourceMap);
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, err, "to advance resource map");
char* anchorPrefix = "ocf://";
const char* anchorPrefix = "ocf://";
// Parse di from anchor
if (!resource->anchor || strncmp(resource->anchor, anchorPrefix, strlen(anchorPrefix)))
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