X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfc_error.c;fp=tfc_error.c;h=b8cc4323b00e610768a5eaf2ce62039a27aaf8d1;hb=370a18a4c47e236b51ad8dee1957c40e11346b96;hp=8e4148251f0a4e15d3f95df252fd8b72b81230b5;hpb=522bfd567b97caa1496044814e42cfd12fbc22d9;p=tfcrypt.git diff --git a/tfc_error.c b/tfc_error.c index 8e41482..b8cc432 100644 --- a/tfc_error.c +++ b/tfc_error.c @@ -28,8 +28,6 @@ #include "tfcrypt.h" -tfc_yesno xexit_no_nl; - void xerror(tfc_yesno noexit, tfc_yesno noerrno, tfc_yesno nostats, const char *fmt, ...) { va_list ap; @@ -39,7 +37,7 @@ void xerror(tfc_yesno noexit, tfc_yesno noerrno, tfc_yesno nostats, const char * va_start(ap, fmt); - if (statline_was_shown == YES && do_statline_dynamic == YES) tfc_esay("\n"); + if (noexit == YES && (statline_was_shown == YES && do_statline_dynamic == YES)) tfc_esay("\n"); tfc_nfsay(stderr, "%s: ", tfc_format_pid(progname)); tfc_vfsay(stderr, NO, fmt, ap); @@ -52,12 +50,9 @@ void xerror(tfc_yesno noexit, tfc_yesno noerrno, tfc_yesno nostats, const char * va_end(ap); if (nostats == NO) { - print_crypt_status(-1); - tfc_esay("\n"); + print_crypt_status(TFC_SIGERR); } - xexit_no_nl = YES; - _do_sil_exit: if (noexit == YES) { errno = 0; @@ -102,7 +97,6 @@ _do_clean_and_exit: memset(pwdask, 0, sizeof(pwdask)); memset(pwdagain, 0, sizeof(pwdagain)); - if (xexit_no_nl == NO) tfc_esay("\n"); exit(status); } @@ -110,8 +104,6 @@ void usage(void) { tfc_yesno is_embedded_prog = NO; - xexit_no_nl = YES; - if (optopt == 'V') { tfc_say("tfcrypt toolkit, version %s.", _TFCRYPT_VERSION); if (do_edcrypt != TFC_DO_PLAIN) {