From 36cc6cc9d6d7d6a737158cb461ec11b78903541e Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 12 Sep 2020 21:23:02 -0700 Subject: [PATCH] fix two bits never being set --- xwords4/common/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xwords4/common/device.c b/xwords4/common/device.c index 0e4f59d2f..a79e5a125 100644 --- a/xwords4/common/device.c +++ b/xwords4/common/device.c @@ -90,8 +90,10 @@ dvc_getMQTTDevID( XW_DUtilCtxt* dutil, XWEnv xwe, MQTTDevID* devID ) // XP_LOGFF( "len: %d; sizeof(tmp): %d", len, sizeof(tmp) ); if ( len != sizeof(tmp) ) { /* not found, or bogus somehow */ tmp = XP_RANDOM(); - tmp <<= 32; - tmp |= XP_RANDOM(); + tmp <<= 27; + tmp ^= XP_RANDOM(); + tmp <<= 27; + tmp ^= XP_RANDOM(); dutil_storePtr( dutil, xwe, MQTT_DEVID_KEY, &tmp, sizeof(tmp) ); #ifdef DEBUG XP_UCHAR buf[32];