'classmark1' is not an integer field in the database

This commit is contained in:
Harald Welte (local) 2009-12-26 18:56:00 +01:00 committed by Harald Welte
parent 6589858167
commit 1f3ecd4050
1 changed files with 3 additions and 1 deletions

View File

@ -312,7 +312,9 @@ static int get_equipment_by_subscr(struct gsm_subscriber *subscr)
if (string)
strncpy(equip->imei, string, sizeof(equip->imei));
cm1 = dbi_result_get_uint(result, "classmark1") & 0xff;
string = dbi_result_get_string(result, "classmark1");
if (string)
cm1 = atoi(string) & 0xff;
equip->classmark1 = *((struct gsm48_classmark1 *) &cm1);
equip->classmark2_len = dbi_result_get_field_length(result, "classmark2");