commit 74e0cf6055d9aa9b0f43ec21d117716f3edbc643
parent 42c072b20fbddf113f3d9f93439aacd171993030
Author: Dominik Schmidt <dominik@schm1dt.ch>
Date: Sun, 6 Jan 2019 20:00:59 +0100
Win32 compatibility
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/nettle.c b/nettle.c
@@ -11,6 +11,11 @@
#include <stdio.h>
#include <stdint.h>
+#if defined(_WIN32)
+ #include <io.h>
+ #include <fcntl.h>
+#endif
+
enum MODE{
ECB,
CBC,
@@ -490,6 +495,9 @@ int main(int argc, char **argv){
struct EncStage es;
int ret;
int i;
+ #if defined(_WIN32)
+ _setmode(_fileno(stdin), _O_BINARY);
+ #endif
String s=readFile(stdin, SIZE_MAX);
String s2;
char *in=s.str;