Browse Source

cmJson.c Fixed bug in _cmJsonFindPathValue() (np==rp) and logic error in cmJsonBoolValue()

master
kevin 11 years ago
parent
commit
7aa3599d27
1 changed files with 4 additions and 5 deletions
  1. 4
    5
      cmJson.c

+ 4
- 5
cmJson.c View File

@@ -1039,15 +1039,14 @@ cmJsonNode_t* cmJsonFindValue( cmJsonH_t h, const char* label, const cmJsonNode_
1039 1039
 }
1040 1040
 
1041 1041
 
1042
-cmJsRC_t  _cmJsonFindPathValue( cmJs_t* p, const char* pathPrefix, const char* path, const cmJsonNode_t* np, const cmJsonNode_t** rpp )
1042
+cmJsRC_t  _cmJsonFindPathValue( cmJs_t* p, const char* pathPrefix, const char* path, const cmJsonNode_t* rp, const cmJsonNode_t** rpp )
1043 1043
 {
1044 1044
   cmJsRC_t rc = kOkJsRC;
1045
-  const cmJsonNode_t* rp = np;
1046 1045
 
1047
-  if( np == NULL )
1046
+  if( rp == NULL )
1048 1047
     rp = p->rootPtr;
1049 1048
 
1050
-  if( np == NULL )
1049
+  if( rp == NULL )
1051 1050
     return kOkJsRC;  
1052 1051
 
1053 1052
   assert( cmJsonIsObject(rp));
@@ -1438,7 +1437,7 @@ cmJsRC_t   cmJsonStringValue( const cmJsonNode_t* vp, const char **retPtrPtr )
1438 1437
 {
1439 1438
   cmJsRC_t rc = kOkJsRC;
1440 1439
   
1441
-  if( vp == NULL && vp->typeId != kStringTId )
1440
+  if( vp == NULL || vp->typeId != kStringTId )
1442 1441
     return kNodeCannotCvtJsRC;
1443 1442
 
1444 1443
   *retPtrPtr = vp->u.stringVal;

Loading…
Cancel
Save