From 4e3558286e39a0fd029d819046bd247f7dd00a42 Mon Sep 17 00:00:00 2001 From: "jpierre%netscape.com" Date: Thu, 6 Dec 2001 03:19:22 +0000 Subject: [PATCH] Improve error handling in cmsutil - don't proceed when error occurs, and display more information about failures using SECU_PrintError --- security/nss/cmd/smimetools/cmsutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/nss/cmd/smimetools/cmsutil.c b/security/nss/cmd/smimetools/cmsutil.c index d1113aa6916b..42f5cf9222db 100644 --- a/security/nss/cmd/smimetools/cmsutil.c +++ b/security/nss/cmd/smimetools/cmsutil.c @@ -34,7 +34,7 @@ /* * cmsutil -- A command to work with CMS data * - * $Id: cmsutil.c,v 1.25 2001/03/23 19:33:59 relyea%netscape.com Exp $ + * $Id: cmsutil.c,v 1.26 2001/12/06 03:19:22 jpierre%netscape.com Exp $ */ #include "nspr.h" @@ -1287,7 +1287,7 @@ main(int argc, char **argv) Usage(progName); exitstatus = 1; } - if (mode == SIGN || mode == ENVELOPE || mode == CERTSONLY) { + if ( (mode == SIGN || mode == ENVELOPE || mode == CERTSONLY) && (!exitstatus) ) { PLArenaPool *arena = PORT_NewArena(1024); NSSCMSEncoderContext *ecx; SECItem output = { 0, 0, 0 }; @@ -1332,7 +1332,7 @@ main(int argc, char **argv) } rv = NSS_CMSEncoder_Finish(ecx); if (rv) { - fprintf(stderr, "%s: failed to encode data.\n", progName); + SECU_PrintError(progName, "failed to encode data"); exit(1); }