diff options
Diffstat (limited to 'security/nss/cmd/btoa')
-rw-r--r-- | security/nss/cmd/btoa/btoa.c | 12 |
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); |