aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/db.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-10-22 15:34:37 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-10-22 15:34:37 +0200
commit2657abfe354bc548f2c90be2a627d927137cf1c8 (patch)
tree56af8d3859d4e4178c3f5eddd24f54d5fdfd9d7d /openbsc/src/db.c
parentb5280c7bc4b3a4540356e2700afd27f0eb177ed4 (diff)
[db] Fix compile warnings in db.c
For the compiler classmark1 is a struct and the compiler is unaware that it fits into an unsigned int. Use memcpy to copy it to a u_int8_t (the compiler should inline this). dbi_conn_quote_binary_copy works on unsigned char* change q_apdu to be unsigned char.
Diffstat (limited to 'openbsc/src/db.c')
-rw-r--r--openbsc/src/db.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/openbsc/src/db.c b/openbsc/src/db.c
index 270d4d90b..b86348c55 100644
--- a/openbsc/src/db.c
+++ b/openbsc/src/db.c
@@ -439,9 +439,11 @@ int db_sync_equipment(struct gsm_equipment *equip)
{
dbi_result result;
unsigned char *cm2, *cm3;
+ u_int8_t classmark1;
+ memcpy(&classmark1, &equip->classmark1, sizeof(classmark1));
printf("DB: Sync Equipment IMEI=%s, classmark1=%02x",
- equip->imei, equip->classmark1);
+ equip->imei, classmark1);
if (equip->classmark2_len)
printf(", classmark2=%s",
hexdump(equip->classmark2, equip->classmark2_len));
@@ -462,7 +464,7 @@ int db_sync_equipment(struct gsm_equipment *equip)
"classmark2 = %s, "
"classmark3 = %s "
"WHERE imei = '%s' ",
- equip->classmark1, cm2, cm3, equip->imei);
+ classmark1, cm2, cm3, equip->imei);
free(cm2);
free(cm3);
@@ -853,7 +855,7 @@ int db_apdu_blob_store(struct gsm_subscriber *subscr,
u_int8_t *apdu)
{
dbi_result result;
- char *q_apdu;
+ unsigned char *q_apdu;
dbi_conn_quote_binary_copy(conn, apdu, len, &q_apdu);