aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2000-07-28 16:19:07 +0000
committerWerner Koch <[email protected]>2000-07-28 16:19:07 +0000
commitd81c3f733ba813dae4fc6bed6073551449dcc65c (patch)
treedc0bc70f697b7b4623d359b172cae2b035347aa3 /g10/gpg.c
parentSee ChangeLog: Tue Jul 25 17:44:15 CEST 2000 Werner Koch (diff)
downloadgnupg-d81c3f733ba813dae4fc6bed6073551449dcc65c.tar.gz
gnupg-d81c3f733ba813dae4fc6bed6073551449dcc65c.zip
See ChangeLog: Fri Jul 28 18:19:11 CEST 2000 Werner Koch
Diffstat (limited to 'g10/gpg.c')
-rw-r--r--g10/gpg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index fb1be046f..11ceb810d 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -25,6 +25,9 @@
#include <string.h>
#include <ctype.h>
#include <unistd.h>
+#ifdef HAVE_DOSISH_SYSTEM
+ #include <fcntl.h> /* for setmode() */
+#endif
#include <gcrypt.h>
@@ -1449,6 +1452,9 @@ main( int argc, char **argv )
size_t n = !endless && count < 100? count : 100;
p = gcry_random_bytes( n, level );
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(stdout), O_BINARY );
+ #endif
fwrite( p, n, 1, stdout );
gcry_free(p);
if( !endless )
@@ -1676,6 +1682,9 @@ print_mds( const char *fname, int algo, const char *key )
if( !fname ) {
fp = stdin;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
pname = gcry_xstrdup("[stdin]: ");
}
else {