Changeset 44
- Timestamp:
- 08/06/05 09:47:07 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/reglookup.c
r43 r44 58 58 */ 59 59 static char* quote_buffer(const unsigned char* str, 60 unsigned int len, c har* special)60 unsigned int len, const char* special) 61 61 { 62 62 unsigned int i; … … 94 94 * character. 95 95 */ 96 static char* quote_string(const char* str, c har* special)96 static char* quote_string(const char* str, const char* special) 97 97 { 98 98 unsigned int len; … … 785 785 fprintf(stderr, "Options:\n"); 786 786 fprintf(stderr, "\t-v\t sets verbose mode.\n"); 787 fprintf(stderr, "\t-s\t prints security descriptors.\n"); 787 fprintf(stderr, "\t-s\t enables security descriptor output.\n"); 788 fprintf(stderr, "\t-S\t disables security descriptor output. (default)\n"); 788 789 fprintf(stderr, "\t-p\t restrict output to elements below this path.\n"); 789 790 fprintf(stderr, "\t-t\t restrict results to this specific data type.\n"); … … 799 800 REGF_NK_REC* root; 800 801 int retr_path_ret; 801 uint32 argi ;802 uint32 argi, arge; 802 803 803 804 /* Process command line arguments */ … … 805 806 { 806 807 usage(); 807 bailOut(1, "ERROR: Requires 1argument.\n");808 bailOut(1, "ERROR: Requires at least one argument.\n"); 808 809 } 809 810 810 for(argi = 1; argi < argc; argi++) 811 arge = argc-1; 812 for(argi = 1; argi < arge; argi++) 811 813 { 812 814 if (strcmp("-p", argv[argi]) == 0) 813 815 { 814 if(++argi > argc)816 if(++argi >= arge) 815 817 { 816 818 usage(); … … 824 826 else if (strcmp("-t", argv[argi]) == 0) 825 827 { 826 if(++argi > argc)828 if(++argi >= arge) 827 829 { 828 830 usage(); … … 839 841 else if (strcmp("-s", argv[argi]) == 0) 840 842 print_security = true; 843 else if (strcmp("-S", argv[argi]) == 0) 844 print_security = false; 841 845 else if (strcmp("-v", argv[argi]) == 0) 842 846 print_verbose = true; 843 else if (argv[argi][0] == '-')847 else 844 848 { 845 849 usage(); … … 847 851 bailOut(1, ""); 848 852 } 849 else 850 { 851 if((registry_file = strdup(argv[argi])) == NULL) 852 bailOut(2, "ERROR: Memory allocation problem.\n"); 853 } 854 } 853 } 854 if((registry_file = strdup(argv[argi])) == NULL) 855 bailOut(2, "ERROR: Memory allocation problem.\n"); 855 856 856 857 f = regfio_open(registry_file);
Note: See TracChangeset
for help on using the changeset viewer.