Revision: 76481
http://sourceforge.net/p/brlcad/code/76481
Author: brlcad
Date: 2020-07-25 04:55:05 +0000 (Sat, 25 Jul 2020)
Log Message:
-----------
make cv work in binary on windows
Modified Paths:
--------------
brlcad/trunk/src/util/cv.c
Modified: brlcad/trunk/src/util/cv.c
===================================================================
--- brlcad/trunk/src/util/cv.c 2020-07-25 04:54:37 UTC (rev 76480)
+++ brlcad/trunk/src/util/cv.c 2020-07-25 04:55:05 UTC (rev 76481)
@@ -91,7 +91,7 @@
}
if (argc == 5) {
- if ((outfp = fopen(argv[4], "w")) == NULL) {
+ if ((outfp = fopen(argv[4], "wb")) == NULL) {
perror(argv[4]);
return 2;
}
@@ -98,9 +98,10 @@
} else {
outfp = stdout;
}
+ setmode(outfp, O_BINARY);
if (argc >= 4) {
- if ((infp = fopen(argv[3], "r")) == NULL) {
+ if ((infp = fopen(argv[3], "rb")) == NULL) {
perror(argv[3]);
return 3;
}
@@ -107,6 +108,7 @@
} else {
infp = stdin;
}
+ setmode(infp, O_BINARY);
if (isatty(fileno(outfp))) {
fprintf(stderr, "cv: trying to send binary output to terminal\n");
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits