Revision: 76542
http://sourceforge.net/p/brlcad/code/76542
Author: brlcad
Date: 2020-07-28 04:55:28 +0000 (Tue, 28 Jul 2020)
Log Message:
-----------
if we reopen the input, make sure it stays binary
Modified Paths:
--------------
brlcad/trunk/src/util/bwshrink.c
brlcad/trunk/src/util/halftone.c
brlcad/trunk/src/util/pixshrink.c
Modified: brlcad/trunk/src/util/bwshrink.c
===================================================================
--- brlcad/trunk/src/util/bwshrink.c 2020-07-28 04:03:18 UTC (rev 76541)
+++ brlcad/trunk/src/util/bwshrink.c 2020-07-28 04:55:28 UTC (rev 76542)
@@ -155,7 +155,7 @@
}
if (bu_optind < ac) {
char *ifname = bu_file_realpath(av[bu_optind], NULL);
- if (freopen(ifname, "r", stdin) == (FILE *)NULL) {
+ if (freopen(ifname, "rb", stdin) == (FILE *)NULL) {
perror(ifname);
bu_exit (-1, NULL);
} else
Modified: brlcad/trunk/src/util/halftone.c
===================================================================
--- brlcad/trunk/src/util/halftone.c 2020-07-28 04:03:18 UTC (rev 76541)
+++ brlcad/trunk/src/util/halftone.c 2020-07-28 04:55:28 UTC (rev 76542)
@@ -894,7 +894,7 @@
}
} else {
char *ifname = bu_file_realpath(argv[bu_optind], NULL);
- if (freopen(ifname, "r", stdin) == NULL ) {
+ if (freopen(ifname, "rb", stdin) == NULL ) {
bu_free(ifname,"ifname alloc from bu_file_realpath");
bu_exit(1, "halftone: cannot open \"%s\" for reading.\n",
argv[bu_optind]);
}
Modified: brlcad/trunk/src/util/pixshrink.c
===================================================================
--- brlcad/trunk/src/util/pixshrink.c 2020-07-28 04:03:18 UTC (rev 76541)
+++ brlcad/trunk/src/util/pixshrink.c 2020-07-28 04:55:28 UTC (rev 76542)
@@ -221,7 +221,7 @@
}
if (bu_optind < ac) {
char *ifname = bu_file_realpath(av[bu_optind], NULL);
- if (freopen(ifname, "r", stdin) == (FILE *)NULL) {
+ if (freopen(ifname, "rb", stdin) == (FILE *)NULL) {
perror(ifname);
bu_free(ifname, "ifname alloc from bu_file_realpath");
bu_exit (-1, NULL);
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