summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-07-20 19:53:00 +0200
committerAleksander Morgado <aleksander@aleksander.es>2016-07-21 09:49:34 +0200
commit488992b0109e2a3fb55a1ebd9180b7fa208a8ff6 (patch)
tree5ee65fc0efdee64fca3d568fe8f74b50c7008cba
parent803caab80a8aea7bcdb846aa2b61cdd0bf794360 (diff)
downloadModemManager-488992b0109e2a3fb55a1ebd9180b7fa208a8ff6.tar.gz
qcdm: avoid upsetting the compiler with wrong aliasing
We shouldn't be accessiing u_int8_t * as u_int16_t *. Let's construct the 16-bit value by or-ing the 8-bit halves directly; avoiding the endianness conversion too.
-rw-r--r--libqcdm/src/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libqcdm/src/commands.c b/libqcdm/src/commands.c
index fe436e971..1c1e93ae5 100644
--- a/libqcdm/src/commands.c
+++ b/libqcdm/src/commands.c
@@ -2081,7 +2081,7 @@ qcdm_cmd_gsm_subsys_state_info_result (const char *buf, size_t len, int *out_err
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_LAI_MNC, mnc);
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_LAI_LAC,
- le16toh (*(u_int16_t *)(&rsp->lai[3])));
+ rsp->lai[4] << 8 | rsp->lai[3]);
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CELLID, le16toh (rsp->cellid));
}