From da4a90c13e03d5a8684c66e7e8e69b174af822a0 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 28 Dec 2019 13:49:40 +0200 Subject: Open files in binary mode This turns off some misfeatures on Windows, and does nothing on POSIX. Signed-off-by: Ran Benita --- test/common.c | 2 +- test/compose.c | 4 ++-- test/interactive-evdev.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/common.c b/test/common.c index 1a56521..3784d8b 100644 --- a/test/common.c +++ b/test/common.c @@ -270,7 +270,7 @@ test_compile_file(struct xkb_context *context, const char *path_rel) if (!path) return NULL; - file = fopen(path, "r"); + file = fopen(path, "rb"); if (!file) { fprintf(stderr, "Failed to open path: %s\n", path); free(path); diff --git a/test/compose.c b/test/compose.c index 89b0e7e..37d33bb 100644 --- a/test/compose.c +++ b/test/compose.c @@ -180,7 +180,7 @@ test_seqs(struct xkb_context *ctx) FILE *file; path = test_get_path("compose/en_US.UTF-8/Compose"); - file = fopen(path, "r"); + file = fopen(path, "rb"); assert(file); free(path); @@ -354,7 +354,7 @@ test_state(struct xkb_context *ctx) FILE *file; path = test_get_path("compose/en_US.UTF-8/Compose"); - file = fopen(path, "r"); + file = fopen(path, "rb"); assert(file); free(path); diff --git a/test/interactive-evdev.c b/test/interactive-evdev.c index edf3919..79da5ec 100644 --- a/test/interactive-evdev.c +++ b/test/interactive-evdev.c @@ -445,7 +445,7 @@ main(int argc, char *argv[]) } if (keymap_path) { - FILE *file = fopen(keymap_path, "r"); + FILE *file = fopen(keymap_path, "rb"); if (!file) { ret = EXIT_FAILURE; fprintf(stderr, "Couldn't open '%s': %s\n", -- cgit v1.2.1