check return value of fwrite in test case

This commit is contained in:
JacobBarthelmeh
2026-03-16 00:07:09 -06:00
parent 681fb41fcb
commit 9b96f49505
+4 -1
View File
@@ -33583,7 +33583,10 @@ static int test_lms_write_key(const byte* priv, word32 privSz, void* context)
FILE* f = fopen((const char*)context, "wb");
if (f == NULL)
return -1;
fwrite(priv, 1, privSz, f);
if (fwrite(priv, 1, privSz, f) != privSz) {
fclose(f);
return -1;
}
fclose(f);
return WC_LMS_RC_SAVED_TO_NV_MEMORY;
}