summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-12-24 07:32:33 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2013-12-24 07:33:58 +0100
commit2d0a5acaf3f3a7045475914832eb5ea0af7b203e (patch)
tree6b34138cd7f26d593c0047641a72da95df4a8b62
parentbf83e024a6f34ff8185e15d7fd5f1291c7453fe7 (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.c10
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 ab8e164..d626a0e 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);
}