From f1bc07dec154a2677a739bed8a4dd3c793bdcddd Mon Sep 17 00:00:00 2001 From: Doug Engert Date: Wed, 12 May 2021 17:17:32 -0500 Subject: [PATCH] Fix piv-tool on wondows fopen needs "rb" for fopen in two places fixes #2338 On branch piv-tool-windows Changes to be committed: modified: piv-tool.c --- src/tools/piv-tool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/piv-tool.c b/src/tools/piv-tool.c index 5944399f..85d24355 100644 --- a/src/tools/piv-tool.c +++ b/src/tools/piv-tool.c @@ -118,7 +118,7 @@ static int load_object(const char * object_id, const char * object_file) int r = -1; struct stat stat_buf; - if(!object_file || (fp=fopen(object_file, "r")) == NULL){ + if(!object_file || (fp=fopen(object_file, "rb")) == NULL){ printf("Cannot open object file, %s %s\n", (object_file)?object_file:"", strerror(errno)); goto err; @@ -184,7 +184,7 @@ static int load_cert(const char * cert_id, const char * cert_file, goto err; } - if((fp=fopen(cert_file, "r"))==NULL){ + if((fp=fopen(cert_file, "rb"))==NULL){ printf("Cannot open cert file, %s %s\n", cert_file, strerror(errno)); goto err;