1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

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.
This commit is contained in:
Hassan Sahibzada 2021-07-22 04:59:09 +01:00 committed by Andy Green
parent e5944a7da2
commit 630d768419

View file

@ -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;
}