From: Richard Levitte Date: Fri, 4 Sep 2015 13:17:29 +0000 (+0200) Subject: Have binary mode when the format is binary, not the other way around X-Git-Tag: OpenSSL_1_1_0-pre1~700 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=afc12d76f80d6ee14df3fc655e3c7e868ae0f368;p=oweals%2Fopenssl.git Have binary mode when the format is binary, not the other way around Fixing a small mixup. Reviewed-by: Tim Hudson --- 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;