1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

Always fopen files with "rb"

We never want translation of newlines when reading files, so it should
be safe to always specify "rb". On sane platforms, the "b" flag is
simply ignored.
This commit is contained in:
Nick Wellnhofer
2022-02-28 23:39:00 +01:00
parent 3f8655db97
commit 655cf3f46f
7 changed files with 7 additions and 45 deletions

View File

@@ -627,11 +627,7 @@ parseSAXFile(char *filename) {
if (push) {
FILE *f;
#if defined(_WIN32)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
@@ -657,11 +653,7 @@ parseSAXFile(char *filename) {
fclose(f);
}
if (!noout) {
#if defined(_WIN32)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
f = fopen(filename, "rb");
if (f != NULL) {
int res, size = 3;
char chars[4096];
@@ -721,11 +713,7 @@ parseAndPrintFile(char *filename) {
if (push) {
FILE *f;
#if defined(_WIN32)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];