Skip to content

Commit

Permalink
Compiler warning files with NO_FILESYSTEM.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Oct 23, 2023
1 parent 862617c commit 1041898
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions examples/keygen/external_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ int TPM2_ExternalImport_Example(void* userCtx, int argc, char *argv[])
TPMT_PUBLIC publicTemplate3;
TPMA_OBJECT attributes;
TPMI_ALG_PUBLIC alg = TPM_ALG_RSA;
#if !defined(NO_FILESYSTEM) && !defined(NO_WRITE_TEMP_FILES)
const char* keyblobFile = "keyblob.bin";
#endif
int loadKeyBlob = 0;

if (argc >= 2) {
Expand Down
7 changes: 5 additions & 2 deletions examples/tpm_test_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ int writeBin(const char* filename, const byte *buf, word32 bufSz)
int readBin(const char* filename, byte *buf, word32* bufSz)
{
int rc = TPM_RC_FAILURE;

if (filename == NULL || buf == NULL)
return BAD_FUNC_ARG;

#if !defined(NO_FILESYSTEM) && !defined(NO_WRITE_TEMP_FILES)
XFILE fp = NULL;
size_t fileSz = 0;
Expand Down Expand Up @@ -100,8 +104,7 @@ int readBin(const char* filename, byte *buf, word32* bufSz)
printf("File %s not found!\n", filename);
}
#else
(void)filename;
(void)key;
(void)bufSz;
#endif /* !NO_FILESYSTEM && !NO_WRITE_TEMP_FILES */
return rc;
}
Expand Down

0 comments on commit 1041898

Please sign in to comment.