Well, I just ran it with no arguements and the checking of argc worked:
Code:
./abconvert
before argc processing.....
************************************************
You didn't specify all 4 arguement:
1st = input address book file
2nd = input address book format
juno = Juno .nv format
3nd = output file
4th = type of conversion:
gmail-csv = output csv file in gmail format
tbird-csv = output csv file in thunderbird format
Can't continue, stopping......
************************************************
So it must be somewhere in the next bit of processing - this is the part where I tried converting to strings instead of char arrays.
That immediately following code:
Code:
printf("\n\nparsing input format....\n\n");
my_input_format = malloc(strlen(argv[3]));
my_input_format = "\0";
printf("\n\ngetting input type...\n\n");
strcpy(my_input_format, argv[2]);
wrk1 = 0;
printf("\n\n");
while (wrk1 = 0)
{
if (0 == strcmp(my_input_format, "juno"))
break;
printf("\n\nInput format unknown: %s\n", my_input_format);
printf(" Must be:\n");
printf(" juno for input in Juno .nv format\n");
printf("(\n");
printf("* Can't continue.......aborting\n\n");
}
printf("\n\ninput type: %s\n\n", my_input_format);
my_output_format = malloc(strlen(argv[3]));
strcpy(my_output_format, argv[4]);
if (0 == strcmp(my_output_format, "gmail-csv"))
wrk1 = 0;
while (wrk1 = 0)
{
if (0 == strcmp(my_output_format, "gmail-csv"))
break;
if (0 == strcmp(my_output_format, "tbird-csv"))
break;
printf("\n\nOutput format unknown: %s\n", my_output_format);
printf(" Must be:\n");
printf(" gmail-csv for gmail csv format\n");
printf(" tbird-csv for Thunderbird csv format\n");
printf("\n");
printf("* Can't continue.......aborting\n\n");
}
Where the 2 receiving strings are defined as:
Code:
char * my_input_format;
char * my_output_format;
I still don't get any of the printf's from that either.
Bookmarks