Changeset 471 for trunk/zoo-project/zoo-kernel/service.h
- Timestamp:
- May 10, 2014, 4:23:03 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service.h
r469 r471 423 423 if(hasKey(m,n)==false){ 424 424 map* _cursor=m; 425 while(_cursor->next!=NULL) 426 _cursor=_cursor->next; 427 _cursor->next=createMap(n,v); 425 if(_cursor->next!=NULL){ 426 addToMap(_cursor->next,n,v); 427 }else 428 _cursor->next=createMap(n,v); 428 429 } 429 430 else{ … … 455 456 } 456 457 else{ 457 if(tmp1->value!=NULL) 458 free(tmp1->value); 459 tmp1->value=zStrdup(tmp->value); 458 addToMap(*mo,tmp->name,tmp->value); 460 459 } 461 460 } … … 480 479 } 481 480 482 static map* getMapOrFill(map* m,const char *key,char* value){483 map* tmp= m;481 static map* getMapOrFill(map** m,const char *key,char* value){ 482 map* tmp=*m; 484 483 map* tmpMap=getMap(tmp,key); 485 484 if(tmpMap==NULL){ 486 485 if(tmp!=NULL) 487 addToMap( tmp,key,value);486 addToMap(*m,key,value); 488 487 else 489 tmp=createMap(key,value);490 tmpMap=getMap( tmp,key);488 (*m)=createMap(key,value); 489 tmpMap=getMap(*m,key); 491 490 } 492 491 return tmpMap; … … 611 610 fprintf(stderr,"%s\n",tmpSize->value); 612 611 #endif 613 map* ptr=getMapOrFill( m,tmp,(char *)"");612 map* ptr=getMapOrFill(&m,tmp,(char *)""); 614 613 free(ptr->value); 615 614 ptr->value=(char*)malloc((atoi(tmpSize->value)+1)*sizeof(char));
Note: See TracChangeset
for help on using the changeset viewer.