diff options
author | nima <nima@abc39116-655e-4be6-ad55-d661dc543056> | 2008-07-01 23:14:17 +0000 |
---|---|---|
committer | nima <nima@abc39116-655e-4be6-ad55-d661dc543056> | 2008-07-01 23:14:17 +0000 |
commit | c10adcd728be238d8579bf98075a2468f0143cc2 (patch) | |
tree | 4fa1bce13ff08de36ff95023af9356fa29c4c5bd /dmiopt.c | |
parent | a7a5cb531b86a75265f106b91d7033e45d754612 (diff) | |
download | python-dmidecode-c10adcd728be238d8579bf98075a2468f0143cc2.tar.gz python-dmidecode-c10adcd728be238d8579bf98075a2468f0143cc2.tar.xz python-dmidecode-c10adcd728be238d8579bf98075a2468f0143cc2.zip |
Brought main() back into the python module and fixed malloc/free problems.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@7 abc39116-655e-4be6-ad55-d661dc543056
Diffstat (limited to 'dmiopt.c')
-rw-r--r-- | dmiopt.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -78,7 +78,7 @@ static void print_opt_type_list(void) } } -static u8 *parse_opt_type(u8 *p, const char *arg) +u8 *parse_opt_type(u8 *p, const char *arg) { unsigned int i; @@ -229,7 +229,9 @@ int parse_command_line(int argc, char * const argv[]) { 0, 0, 0, 0 } }; - while((option=getopt_long(argc, argv, optstring, longopts, NULL))!=-1) + int i = 0; + while((option=getopt_long(argc, argv, optstring, longopts, NULL))!=-1) { + i++; switch(option) { case 'd': @@ -272,6 +274,9 @@ int parse_command_line(int argc, char * const argv[]) return -1; } + } + printf("%d: %s, %s, %s --> %d loops\n", argc, argv[0], argv[1], argv[2], i); + if(opt.type!=NULL && opt.string!=NULL) { fprintf(stderr, "Options --string and --type are mutually exclusive\n"); |