summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gsm/gsm48.c3
-rw-r--r--src/utils.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index f69eee20..10e2b804 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
+#include <inttypes.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/byteswap.h>
@@ -637,7 +638,7 @@ int gsm48_mi_to_string(char *string, const int str_len, const uint8_t *mi,
/* Table 10.5.4.3, reverse generate_mid_from_tmsi */
if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) {
tmsi = osmo_load32be(&mi[1]);
- return snprintf(string, str_len, "%u", tmsi);
+ return snprintf(string, str_len, "%"PRIu32, tmsi);
}
break;
case GSM_MI_TYPE_IMSI:
diff --git a/src/utils.c b/src/utils.c
index 9e3414b2..a1881f06 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -26,6 +26,7 @@
#include <stdint.h>
#include <errno.h>
#include <stdio.h>
+#include <inttypes.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/bit64gen.h>
@@ -54,7 +55,7 @@ const char *get_value_string(const struct value_string *vs, uint32_t val)
if (str)
return str;
- snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val);
+ snprintf(namebuf, sizeof(namebuf), "unknown 0x%"PRIx32, val);
namebuf[sizeof(namebuf) - 1] = '\0';
return namebuf;
}