diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index ea7e886a1..3a538e3cb 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -1756,7 +1756,7 @@ device supports, or you may have recently removed its last way of connecting.) - Network status for game (ID=%2$d) connected via + Network status for game (ID=%2$X) connected via %1$s: diff --git a/xwords4/common/device.c b/xwords4/common/device.c index 6d3d79562..d2401e8ae 100644 --- a/xwords4/common/device.c +++ b/xwords4/common/device.c @@ -464,7 +464,7 @@ void dvc_parseMQTTPacket( XW_DUtilCtxt* dutil, XWEnv xwe, const XP_UCHAR* topic, const XP_U8* buf, XP_U16 len ) { - XP_LOGFF( "(topic=%s)", topic ); + XP_LOGFF( "(topic=%s, len=%d)", topic, len ); MQTTDevID myID; dvc_getMQTTDevID( dutil, xwe, &myID ); @@ -474,8 +474,9 @@ dvc_parseMQTTPacket( XW_DUtilCtxt* dutil, XWEnv xwe, const XP_UCHAR* topic, XWStreamCtxt* stream = mkStream( dutil ); stream_putBytes( stream, buf, len ); - XP_U8 proto = stream_getU8( stream ); - if ( proto == PROTO_1 || proto == PROTO_2 || proto == PROTO_3 ) { + XP_U8 proto = 0; + if ( stream_gotU8( stream, &proto ) + && (proto == PROTO_1 || proto == PROTO_2 || proto == PROTO_3 ) ) { MQTTDevID senderID; stream_getBytes( stream, &senderID, sizeof(senderID) ); senderID = be64toh( senderID );