summaryrefslogtreecommitdiff
path: root/security/nss/cmd/btoa
diff options
context:
space:
mode:
authorrepka%netscape.com <devnull@localhost>2000-04-06 00:15:54 +0000
committerrepka%netscape.com <devnull@localhost>2000-04-06 00:15:54 +0000
commit7714a51ee7d1cd6af6c6fb4afc008ba13f494d12 (patch)
tree4220d330f4955515e93a3f14cf5509bea69628af /security/nss/cmd/btoa
parent6d603600dbcb062bdd45aaa97d36cb6667578ec1 (diff)
downloadnss-hg-7714a51ee7d1cd6af6c6fb4afc008ba13f494d12.tar.gz
Add a trailing CRLF; the encoder doesn't.
Diffstat (limited to 'security/nss/cmd/btoa')
-rw-r--r--security/nss/cmd/btoa/btoa.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/security/nss/cmd/btoa/btoa.c b/security/nss/cmd/btoa/btoa.c
index 6552c0cbe..0617fb3d6 100644
--- a/security/nss/cmd/btoa/btoa.c
+++ b/security/nss/cmd/btoa/btoa.c
@@ -94,7 +94,17 @@ encode_file(FILE *outFile, FILE *inFile)
if (status != SECSuccess) goto loser;
}
- return NSSBase64Encoder_Destroy(cx, PR_FALSE);
+ status = NSSBase64Encoder_Destroy(cx, PR_FALSE);
+ if (status != SECSuccess)
+ return status;
+
+ /*
+ * Add a trailing CRLF. Note this must be done *after* the call
+ * to Destroy above (because only then are we sure all data has
+ * been written out).
+ */
+ fwrite("\r\n", 1, 2, outFile);
+ return SECSuccess;
loser:
(void) NSSBase64Encoder_Destroy(cx, PR_TRUE);