Skip to content

Commit

Permalink
Add a trailing CRLF; the encoder doesn't.
Browse files Browse the repository at this point in the history
  • Loading branch information
repka%netscape.com committed Apr 6, 2000
1 parent 7e1e468 commit 9bfcc13
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion security/nss/cmd/btoa/btoa.c
Expand Up @@ -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);
Expand Down

0 comments on commit 9bfcc13

Please sign in to comment.