summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-06-09 08:52:41 +0000
committerHolger Freyther <zecke@selfish.org>2009-06-09 08:52:41 +0000
commit91754473cab6721f2c7fd646bdb29ec3fa698241 (patch)
tree2cf89d6c4cd88ddb58a153f8fff4e6dd0c8de724 /src
parentd51524f654205c776c8c00c2ab0fe169ba3a9ed7 (diff)
db.c: tmsi may be empty so put it into '' to make that obvoius (Andreas Eversberg)
during attachment, the "tmsi" field of the subscriber may be an empty string, so the string must be quoted in the sql request, or the sql request fails due to incorrect syntax. also i added "extension" field to debug output.
Diffstat (limited to 'src')
-rw-r--r--src/db.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db.c b/src/db.c
index 4abd63624..600699ae7 100644
--- a/src/db.c
+++ b/src/db.c
@@ -261,8 +261,8 @@ struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const
subscr->lac = dbi_result_get_uint(result, "lac");
subscr->authorized = dbi_result_get_uint(result, "authorized");
- printf("DB: Found Subscriber: ID %llu, IMSI %s, NAME '%s', TMSI %s, LAC %hu, AUTH %u\n",
- subscr->id, subscr->imsi, subscr->name, subscr->tmsi,
+ printf("DB: Found Subscriber: ID %llu, IMSI %s, NAME '%s', TMSI %s, EXTEN '%s', LAC %hu, AUTH %u\n",
+ subscr->id, subscr->imsi, subscr->name, subscr->tmsi, subscr->extension,
subscr->lac, subscr->authorized);
dbi_result_free(result);
return subscr;
@@ -273,7 +273,7 @@ int db_sync_subscriber(struct gsm_subscriber* subscriber) {
result = dbi_conn_queryf(conn,
"UPDATE Subscriber "
"SET updated = datetime('now'), "
- "tmsi = %s, "
+ "tmsi = '%s', "
"lac = %i, "
"authorized = %i "
"WHERE imsi = %s ",