From 630d768419f8a017519ac54b88870f93557c8fce Mon Sep 17 00:00:00 2001 From: Hassan Sahibzada Date: Thu, 22 Jul 2021 04:59:09 +0100 Subject: [PATCH] b64: add downcasts for gcc 4.4 gcc 4.4 complains with the following: warning: conversion to 'char' from 'int' may alter its value After the explicit cast the warning is gone. --- lib/misc/base64-decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/misc/base64-decode.c b/lib/misc/base64-decode.c index f8e8e49a4..9d18b33fc 100644 --- a/lib/misc/base64-decode.c +++ b/lib/misc/base64-decode.c @@ -72,9 +72,9 @@ _lws_b64_encode_string(const char *encode, const char *in, int in_len, *out++ = encode[triple[0] >> 2]; *out++ = encode[(((triple[0] & 0x03) << 4) & 0x30) | (((triple[1] & 0xf0) >> 4) & 0x0f)]; - *out++ = (len > 1 ? encode[(((triple[1] & 0x0f) << 2) & 0x3c) | + *out++ = (char)(len > 1 ? encode[(((triple[1] & 0x0f) << 2) & 0x3c) | (((triple[2] & 0xc0) >> 6) & 3)] : '='); - *out++ = (len > 2 ? encode[triple[2] & 0x3f] : '='); + *out++ = (char)(len > 2 ? encode[triple[2] & 0x3f] : '='); done += 4; }