From 23fcfed2fb1554e41e7fb483be55506b5e33c20f Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 11 Apr 2013 00:27:14 -0700 Subject: [PATCH] cmJson.c:cmJsonInserPairString() now passes NULL string value as 0 length string. --- cmJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmJson.c b/cmJson.c index b34399f..328ded3 100644 --- a/cmJson.c +++ b/cmJson.c @@ -2056,7 +2056,7 @@ cmJsRC_t cmJsonInsertPairReal( cmJsonH_t h, cmJsonNode_t* objectNodePtr, } cmJsRC_t cmJsonInsertPairString( cmJsonH_t h, cmJsonNode_t* objectNodePtr, const char* label, const char* stringVal ) -{ return cmJsonInsertPairStringN(h,objectNodePtr,label,stringVal,strlen(stringVal)); } +{ return cmJsonInsertPairStringN(h,objectNodePtr,label,stringVal,stringVal==NULL ? 0 : strlen(stringVal)); } cmJsRC_t cmJsonInsertPairStringN( cmJsonH_t h, cmJsonNode_t* objectNodePtr, const char* label, const char* stringVal, unsigned stringCharCnt ) {