From afc12d76f80d6ee14df3fc655e3c7e868ae0f368 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 4 Sep 2015 15:17:29 +0200 Subject: [PATCH] Have binary mode when the format is binary, not the other way around Fixing a small mixup. Reviewed-by: Tim Hudson --- apps/openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openssl.c b/apps/openssl.c index 7e340be21a..bfd77a55b4 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -305,11 +305,11 @@ static const char *modestr(char mode, int format) switch (mode) { case 'a': - return (format) & B_FORMAT_TEXT ? "ab" : "a"; + return (format & B_FORMAT_TEXT) ? "a" : "ab"; case 'r': - return (format) & B_FORMAT_TEXT ? "rb" : "r"; + return (format & B_FORMAT_TEXT) ? "r" : "rb"; case 'w': - return (format) & B_FORMAT_TEXT ? "wb" : "w"; + return (format & B_FORMAT_TEXT) ? "w" : "wb"; } /* The assert above should make sure we never reach this point */ return NULL; -- 2.40.0