Changeset 268 for branches/branch-1.2/zoo-kernel/service.h
- Timestamp:
- Jul 16, 2011, 12:58:47 PM (13 years ago)
- Location:
- branches/branch-1.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1.2
-
branches/branch-1.2/zoo-kernel/service.h
r217 r268 124 124 map* tmp=t; 125 125 while(tmp!=NULL){ 126 fprintf(file,"%s = %s\n",t->name,t->value); 126 fprintf(stderr,"%s = %s\n",tmp->name,tmp->value); 127 fprintf(file,"%s = %s\n",tmp->name,tmp->value); 127 128 tmp=tmp->next; 128 129 } … … 138 139 } 139 140 140 static void dumpMapsToFile(maps* m,FILE* file){ 141 static void dumpMapsToFile(maps* m,char* file_path){ 142 FILE* file=fopen(file_path,"w"); 141 143 maps* tmp=m; 142 144 if(tmp!=NULL){ 143 145 fprintf(file,"[%s]\n",tmp->name); 144 146 dumpMapToFile(tmp->content,file); 145 } 147 fflush(file); 148 } 149 fclose(file); 146 150 } 147 151 … … 549 553 map* tmpV=getMap(res->content,"value"); 550 554 free(tmpV->value); 551 tmpV->value=(char*)malloc( atoi(tmp->value)*sizeof(char));555 tmpV->value=(char*)malloc((atoi(tmp->value)+1)*sizeof(char)); 552 556 memmove(tmpV->value,tmpSized,atoi(tmp->value)*sizeof(char)); 557 tmpV->value[atoi(tmp->value)]=0; 553 558 free(tmpSized); 554 559 }
Note: See TracChangeset
for help on using the changeset viewer.