diff options
author | Arnaud Ferraris <aferraris@debian.org> | 2023-10-21 11:43:09 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2023-11-20 15:27:11 +0000 |
commit | 6662764338d3127924cfefaa9cf1b0cc4f90a189 (patch) | |
tree | be8747286bd987170ffef5e2c96e0c3f74efe219 | |
parent | 84c08fa882a2e3aceee87e72a85d029b1bd4a75e (diff) |
libqmi-glib,message: fix 16-bit service on big endian architectures
The latest release introduces handling of 16-bit service indications.
However, only the raw message data is returned from
`qmi_message_get_service()`, leading to incorrect values on big-endian
architectures. As a consequence, `libqmi` ultimately fails to build as
the corresponding test errors out in this case.
This patch ensures the service indication is correct on all kinds of
architectures.
-rw-r--r-- | src/libqmi-glib/qmi-message.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c index 3e31b4b..1918a45 100644 --- a/src/libqmi-glib/qmi-message.c +++ b/src/libqmi-glib/qmi-message.c @@ -226,7 +226,7 @@ qmi_message_get_service (QmiMessage *self) if (MESSAGE_IS_QMUX (self)) return (QmiService)((struct full_message *)(self->data))->header.qmux.service; - return (QmiService)((struct full_message *)(self->data))->header.qrtr.service; + return (QmiService)GUINT16_FROM_LE (((struct full_message *)(self->data))->header.qrtr.service); } guint8 |