From 7cf09239ae6c36d42689d645d8d6e37642f85a3d Mon Sep 17 00:00:00 2001 From: Aaron C Gaudette Date: Thu, 10 Jun 2021 18:17:20 -0400 Subject: [PATCH] Open pbm file in binary mode - Fix corrupted binary file on windows (cherry picked from commit e1665066326b4cd9a92a2b314d2661df37d14973) --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index 9666127..ce82f5d 100644 --- a/lib.c +++ b/lib.c @@ -617,7 +617,7 @@ static unsigned char *read_font() // Read custom PBM file { errno = 0; strncpy(filename, "font.pbm", 8 + 1); - FILE *file = fopen(root_path, "r"); + FILE *file = fopen(root_path, "rb"); if (errno) { fprintf( stderr,