[winpr,sspi] fix wchar to byte endianess

This commit is contained in:
akallabeth 2024-07-22 13:39:35 +02:00
parent 775dac79db
commit 0b0eae2adc
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
1 changed files with 13 additions and 0 deletions

View File

@ -323,6 +323,19 @@ fail:
static int hexchar2nibble(WCHAR wc)
{
#if defined(__BIG_ENDIAN__)
union
{
BYTE b[2];
WCHAR w;
} cnv;
cnv.w = wc;
const BYTE b = cnv.b[0];
cnv.b[0] = cnv.b[1];
cnv.b[1] = b;
wc = cnv.w;
#endif
switch (wc)
{
case L'0':