diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2009-05-10 22:38:19 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2009-05-10 22:38:19 +0000 |
commit | 9d973f407203e7b866fb84d5958b2961fe003e2a (patch) | |
tree | e8867145ebe29fbda9223e6d646601ba58d564a6 /utils | |
parent | bffd54967a50e5debb2a5a58eb42267750bb008b (diff) | |
download | sg3_utils-9d973f407203e7b866fb84d5958b2961fe003e2a.tar.gz |
In MinGW set binary mode on stdin if it is used.
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@263 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'utils')
-rw-r--r-- | utils/hxascdmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/hxascdmp.c b/utils/hxascdmp.c index 7a5a266b..8fb141ac 100644 --- a/utils/hxascdmp.c +++ b/utils/hxascdmp.c @@ -39,7 +39,7 @@ static int bytes_per_line = DEF_BYTES_PER_LINE; -static const char * version_str = "1.12 20090422"; +static const char * version_str = "1.13 20090510"; #define CHARS_PER_HEX_BYTE 3 #define BINARY_START_COL 6 @@ -210,7 +210,7 @@ main(int argc, const char ** argv) int num = 8192; long start = 0; int res, k, u; - int inFile = 0; /* stdin */ + int inFile = STDIN_FILENO; int doHelp = 0; int doHex = 0; int hasFilename = 0; @@ -277,6 +277,7 @@ main(int argc, const char ** argv) printf("\n"); } } else { + sg_set_binary_mode(inFile); while ((res = read(inFile, buff, num)) > 0) { if (doHex) dStrHexOnly(buff, res, start); |