Skip to content

Commit 04a6ec6

Browse files
committed
Fix ferror(NULL) in xmss_common.h
1 parent c748f4c commit 04a6ec6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/xmss/xmss_common.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ static enum wc_XmssRc xmss_write_key(const byte * priv, word32 privSz, void * co
4848
/* Create the file if it didn't exist. */
4949
file = fopen(filename, "w+");
5050
if (!file) {
51-
fprintf(stderr, "error: fopen(%s, \"w+\") failed: %d\n", filename,
52-
ferror(file));
51+
fprintf(stderr, "error: fopen(%s, \"w+\") failed.\n", filename);
5352
return WC_XMSS_RC_WRITE_FAIL;
5453
}
5554
}
@@ -72,8 +71,7 @@ static enum wc_XmssRc xmss_write_key(const byte * priv, word32 privSz, void * co
7271
* storage correctly. */
7372
file = fopen(filename, "r+");
7473
if (!file) {
75-
fprintf(stderr, "error: fopen(%s, \"r+\") failed: %d\n", filename,
76-
ferror(file));
74+
fprintf(stderr, "error: fopen(%s, \"r+\") failed.\n", filename);
7775
return WC_XMSS_RC_WRITE_FAIL;
7876
}
7977

0 commit comments

Comments
 (0)