LRN: Use binary mode on W32 (lol -CG)
authorChristian Grothoff <christian@grothoff.org>
Thu, 16 Feb 2012 12:58:11 +0000 (12:58 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 16 Feb 2012 12:58:11 +0000 (12:58 +0000)
src/fs/gnunet-helper-fs-publish.c

index 9594c19c2b2588f05dabe65ed2f37b0da7a6280a..d3008994f048f00c86fe4cad80f90969948ffbfe 100644 (file)
@@ -401,6 +401,13 @@ int main(int argc,
   const char *ex;
   struct ScanTreeNode *root;
 
+#if WINDOWS
+  /* We're using stdout to communicate binary data back to the parent; use
+   * binary mode.
+   */
+  _setmode (1, _O_BINARY);
+#endif
+
   /* parse command line */
   if ( (argc != 3) && (argc != 2) )
   {