Browse Source

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

master
kevin 12 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
 }
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
   cmJsRC_t rc = kOkJsRC;
1044
   cmJsRC_t rc = kOkJsRC;
1045
-  const cmJsonNode_t* rp = np;
1046
 
1045
 
1047
-  if( np == NULL )
1046
+  if( rp == NULL )
1048
     rp = p->rootPtr;
1047
     rp = p->rootPtr;
1049
 
1048
 
1050
-  if( np == NULL )
1049
+  if( rp == NULL )
1051
     return kOkJsRC;  
1050
     return kOkJsRC;  
1052
 
1051
 
1053
   assert( cmJsonIsObject(rp));
1052
   assert( cmJsonIsObject(rp));
1438
 {
1437
 {
1439
   cmJsRC_t rc = kOkJsRC;
1438
   cmJsRC_t rc = kOkJsRC;
1440
   
1439
   
1441
-  if( vp == NULL && vp->typeId != kStringTId )
1440
+  if( vp == NULL || vp->typeId != kStringTId )
1442
     return kNodeCannotCvtJsRC;
1441
     return kNodeCannotCvtJsRC;
1443
 
1442
 
1444
   *retPtrPtr = vp->u.stringVal;
1443
   *retPtrPtr = vp->u.stringVal;

Loading…
Cancel
Save