Преглед изворни кода

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

master
kevin пре 11 година
родитељ
комит
7aa3599d27
1 измењених фајлова са 4 додато и 5 уклоњено
  1. 4
    5
      cmJson.c

+ 4
- 5
cmJson.c Прегледај датотеку

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…
Откажи
Сачувај