diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-12-24 07:32:33 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2014-12-29 16:26:20 +0100 |
commit | 39304b742ab18fe8a9f06310e17b8a95a7fcee0e (patch) | |
tree | b428f8be91e51c8cfaad676f46704243e2ece732 | |
parent | c1d728975f4c062907b024a286c1a72f0ae05c11 (diff) |
mobile/SS: Fixed bug in parsing of known supplemenary service codes
Use correct variable to check if supplementary service code is known
or not.
-rw-r--r-- | src/host/layer23/src/mobile/gsm480_ss.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/host/layer23/src/mobile/gsm480_ss.c b/src/host/layer23/src/mobile/gsm480_ss.c index fda62881..9b749d3e 100644 --- a/src/host/layer23/src/mobile/gsm480_ss.c +++ b/src/host/layer23/src/mobile/gsm480_ss.c @@ -637,7 +637,7 @@ int ss_send(struct osmocom_ms *ms, const char *code, int new_trans) uint8_t ss_code = 0; ss_code_by_char(code + 2, &ss_code); - if (code) + if (ss_code) return gsm480_tx_cf(trans, GSM0480_MTYPE_REGISTER, GSM0480_OP_CODE_INTERROGATE_SS, ss_code, NULL); } else @@ -654,7 +654,7 @@ int ss_send(struct osmocom_ms *ms, const char *code, int new_trans) to = ss_code_by_char(code + 1, &ss_code); /* register */ - if (code && to && to[0] == '*') { + if (ss_code && to && to[0] == '*') { strncpy(dest, to + 1, sizeof(dest) - 1); dest[sizeof(dest) - 1] = '\0'; dest[strlen(dest) - 1] = '\0'; @@ -662,7 +662,7 @@ int ss_send(struct osmocom_ms *ms, const char *code, int new_trans) GSM0480_OP_CODE_REGISTER_SS, ss_code, dest); } /* activate */ - if (code && to && to[0] == '#') { + if (ss_code && to && to[0] == '#') { return gsm480_tx_cf(trans, GSM0480_MTYPE_REGISTER, GSM0480_OP_CODE_ACTIVATE_SS, ss_code, NULL); } @@ -673,7 +673,7 @@ int ss_send(struct osmocom_ms *ms, const char *code, int new_trans) ss_code_by_char(code + 2, &ss_code); - if (code) + if (ss_code) return gsm480_tx_cf(trans, GSM0480_MTYPE_REGISTER, GSM0480_OP_CODE_ERASE_SS, ss_code, NULL); } else @@ -683,7 +683,7 @@ int ss_send(struct osmocom_ms *ms, const char *code, int new_trans) ss_code_by_char(code + 1, &ss_code); - if (code) + if (ss_code) return gsm480_tx_cf(trans, GSM0480_MTYPE_REGISTER, GSM0480_OP_CODE_DEACTIVATE_SS, ss_code, NULL); } |