]> git.meshlink.io Git - meshlink/blobdiff - src/ed25519/seed.c
Add a configurable fast connection retry period.
[meshlink] / src / ed25519 / seed.c
index 25e518220f742c970bf07299a32a7379ecd20c72..15f41c0a8d96b458265120789682770ad1093a87 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef ED25519_NO_SEED
 
 #ifdef _WIN32
-#include <Windows.h>
-#include <Wincrypt.h>
+#include <windows.h>
+#include <wincrypt.h>
 #else
 #include <stdio.h>
 #endif
@@ -30,11 +30,15 @@ int ed25519_create_seed(unsigned char *seed) {
         return 1;
     }
 
-    fread(seed, 1, 32, f);
+    if(fread(seed, 32, 1, f) != 1) {
+           fclose(f);
+           return 1;
+    }
+
     fclose(f);
 #endif
 
     return 0;
 }
 
-#endif
\ No newline at end of file
+#endif