tools/tpm: write policy output in binary mode

F/1896
pull/751/head
Daniele Lacamera 2026-04-15 17:33:37 +02:00
parent 1359aac80d
commit d4f062a773
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ int writeBin(const char* filename, const uint8_t*buf, word32 bufSz)
XFILE fp = NULL;
size_t fileSz = 0;
fp = XFOPEN(filename, "wt");
fp = XFOPEN(filename, "wb");
if (fp != XBADFILE) {
fileSz = XFWRITE(buf, 1, bufSz, fp);
/* sanity check */

View File

@ -224,7 +224,7 @@ static int writeBin(const char* filename, const byte *buf, word32 bufSz)
FILE *fp = NULL;
size_t fileSz = 0;
fp = fopen(filename, "wt");
fp = fopen(filename, "wb");
if (fp != NULL) {
fileSz = fwrite(buf, 1, bufSz, fp);
/* sanity check */