From: Juergen Perlinger Date: Fri, 2 Jan 2015 16:23:21 +0000 (+0100) Subject: [Bug 2627] sidekick: avoid runtime conversion trap on MSVC builds X-Git-Tag: NTP_4_2_8P1_BETA3~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09830581363ff0d2e99cb0782b7212a22d7234ec;p=thirdparty%2Fntp.git [Bug 2627] sidekick: avoid runtime conversion trap on MSVC builds bk: 54a6c5f9ms6OJzQMGV6b2NGjSXi7zA --- diff --git a/ntpd/ntp_leapsec.c b/ntpd/ntp_leapsec.c index 14b8cd99f..23736f4c6 100644 --- a/ntpd/ntp_leapsec.c +++ b/ntpd/ntp_leapsec.c @@ -920,7 +920,8 @@ do_leap_hash( /* now do the byte twiddle */ for (wi=0; wi < 5; ++wi) for (di=3; di >= 0; --di) { - mac->hv[wi*4 + di] = (unsigned char)tmp[wi]; + mac->hv[wi*4 + di] = + (unsigned char)(tmp[wi] & 0x0FF); tmp[wi] >>= 8; } return TRUE;