aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2021-10-10 01:28:38 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2021-11-07 20:00:42 +0100
commitb0b0046ad316c26ae91e32b5cc3a87be79c3e50b (patch)
tree302c78504f3bccf05eaee203dd563ae618398afb
parent423bc4242908a4b2082a23bf817e62db2e28c58e (diff)
Fixed minor compiler warning
-rwxr-xr-x[-rw-r--r--]src/libmobile/console.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libmobile/console.c b/src/libmobile/console.c
index ee533b0..7e63422 100644..100755
--- a/src/libmobile/console.c
+++ b/src/libmobile/console.c
@@ -270,8 +270,10 @@ void console_msg(osmo_cc_call_t *call, osmo_cc_msg_t *msg)
osmo_cc_free_msg(msg);
return;
}
- if (caller_id[0])
- strncpy(console.station_id, caller_id, sizeof(console.station_id) - 1);
+ if (caller_id[0]) {
+ strncpy(console.station_id, caller_id, sizeof(console.station_id));
+ console.station_id[sizeof(console.station_id) - 1] = '\0';
+ }
strncpy(console.dialing, number, sizeof(console.dialing) - 1);
console.dialing[sizeof(console.dialing) - 1] = '\0';
console_new_state(CONSOLE_CONNECT);
@@ -297,8 +299,10 @@ void console_msg(osmo_cc_call_t *call, osmo_cc_msg_t *msg)
PDEBUG(DCC, DEBUG_INFO, "Call connected to '%s'\n", caller_id);
osmo_cc_helper_audio_negotiate(msg, &console.session, &console.codec);
console_new_state(CONSOLE_CONNECT);
- if (caller_id[0])
- strncpy(console.station_id, caller_id, sizeof(console.station_id) - 1);
+ if (caller_id[0]) {
+ strncpy(console.station_id, caller_id, sizeof(console.station_id));
+ console.station_id[sizeof(console.station_id) - 1] = '\0';
+ }
request_answer_ack(console.callref);
break;
}