Changeset 52
- Timestamp:
- 08/08/05 20:43:07 (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/void_stack.c
r38 r52 90 90 void void_stack_destroy(void_stack* stack) 91 91 { 92 free(stack->elements); 92 93 free(stack); 93 94 } … … 99 100 for(i=0; i < stack->top; i++) 100 101 free(stack->elements[i]); 102 free(stack->elements); 101 103 free(stack); 102 104 } … … 127 129 if(stack->top > 0) 128 130 { 129 ret_val = stack->elements[-- stack->top];131 ret_val = stack->elements[--(stack->top)]; 130 132 stack->elements[stack->top] = NULL; 131 133 } -
trunk/src/reglookup.c
r48 r52 640 640 void printKeyTree(REGF_FILE* f, void_stack* nk_stack, char* prefix) 641 641 { 642 REGF_NK_REC* cur ;643 REGF_NK_REC* sub ;642 REGF_NK_REC* cur = NULL; 643 REGF_NK_REC* sub = NULL; 644 644 char* path = NULL; 645 645 char* val_path = NULL; … … 703 703 void_stack* path_stack) 704 704 { 705 REGF_NK_REC* sub ;706 REGF_NK_REC* cur ;705 REGF_NK_REC* sub = NULL; 706 REGF_NK_REC* cur = NULL; 707 707 void_stack* sub_nk_stack; 708 708 char* prefix; 709 uint32 prefix_len; 709 710 char* cur_str = NULL; 710 711 bool found_cur = true; … … 765 766 sub_nk_stack = void_stack_new(1024); 766 767 void_stack_push(sub_nk_stack, sub); 767 void_stack_push(nk_stack, sub);768 768 prefix = stack2Path(nk_stack); 769 prefix_len = strlen(prefix); 770 prefix = realloc(prefix, prefix_len+strlen(sub->keyname)+2); 771 if(prefix == NULL) 772 return -1; 773 strcat(prefix, "/"); 774 strcat(prefix, sub->keyname); 769 775 printKeyTree(f, sub_nk_stack, prefix); 770 776 return 0;
Note: See TracChangeset
for help on using the changeset viewer.