From 7aa3599d279ce46c0b908aec72ba89a0e6530f7e Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 3 Dec 2012 17:10:26 -0800 Subject: [PATCH] cmJson.c Fixed bug in _cmJsonFindPathValue() (np==rp) and logic error in cmJsonBoolValue() --- cmJson.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmJson.c b/cmJson.c index 52952a5..0963112 100644 --- a/cmJson.c +++ b/cmJson.c @@ -1039,15 +1039,14 @@ cmJsonNode_t* cmJsonFindValue( cmJsonH_t h, const char* label, const cmJsonNode_ } -cmJsRC_t _cmJsonFindPathValue( cmJs_t* p, const char* pathPrefix, const char* path, const cmJsonNode_t* np, const cmJsonNode_t** rpp ) +cmJsRC_t _cmJsonFindPathValue( cmJs_t* p, const char* pathPrefix, const char* path, const cmJsonNode_t* rp, const cmJsonNode_t** rpp ) { cmJsRC_t rc = kOkJsRC; - const cmJsonNode_t* rp = np; - if( np == NULL ) + if( rp == NULL ) rp = p->rootPtr; - if( np == NULL ) + if( rp == NULL ) return kOkJsRC; assert( cmJsonIsObject(rp)); @@ -1438,7 +1437,7 @@ cmJsRC_t cmJsonStringValue( const cmJsonNode_t* vp, const char **retPtrPtr ) { cmJsRC_t rc = kOkJsRC; - if( vp == NULL && vp->typeId != kStringTId ) + if( vp == NULL || vp->typeId != kStringTId ) return kNodeCannotCvtJsRC; *retPtrPtr = vp->u.stringVal;