X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;ds=sidebyside;f=abook.c;h=c7efa0992a9a96bf49e9ee253e6d51f8b16a8303;hb=00afcdbf62dbf2233c2e09fc9b0abe305a6988e7;hp=74ade409606f089acae4cf9d0299f16fb08d6b66;hpb=d728d9926c4a6cc24bb13b4f3694a65df15c4eec;p=pkg%2Fabook.git diff --git a/abook.c b/abook.c index 74ade40..c7efa09 100644 --- a/abook.c +++ b/abook.c @@ -456,22 +456,27 @@ convert(char *srcformat, char *srcfile, char *dstformat, char *dstfile) switch( import(srcformat, srcfile) ) { case -1: - printf("input format %s not supported\n", srcformat); + fprintf(stderr, + "input format %s not supported\n", srcformat); ret = 1; + break; case 1: - printf("cannot read file %s\n", srcfile); + fprintf(stderr, "cannot read file %s\n", srcfile); ret = 1; + break; } if(!ret) switch( export(dstformat, dstfile) ) { case -1: - printf("output format %s not supported\n", - dstformat); + fprintf(stderr, + "output format %s not supported\n", + dstformat); ret = 1; break; case 1: - printf("cannot write file %s\n", dstfile); + fprintf(stderr, + "cannot write file %s\n", dstfile); ret = 1; break; } @@ -503,6 +508,12 @@ quit_add_email() exit(0); } +static void +quit_add_email_sig(int signal) +{ + quit_add_email(); +} + static void init_add_email() { @@ -518,7 +529,7 @@ init_add_email() atexit(close_database); - signal(SIGINT, quit_add_email); + signal(SIGINT, quit_add_email_sig); } static int @@ -569,7 +580,6 @@ add_email(int quiet) line = getaline(stdin); if(line && !strncasecmp("From:", line, 5) ) { getname(line, &name, &email); - my_free(line); add_email_count += add_email_add_item(quiet, name, email); my_free(name);