diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-01-13 03:12:08 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-01-23 11:59:01 +0000 |
commit | 93bafb611a58293e0353320a14db298133c9d99a (patch) | |
tree | 4ba6d276b7f5e2fda43f21b765d7cca8c6b00d5e /openbsc/src/libmsc/ctrl_commands.c | |
parent | 59504dc80fe8c0d9a18994d82586a550c7efa341 (diff) |
cosmetic: use osmo_strlcpy() everywhere
Shorten some code and make obvious to the reader that the string copy is done
in a safe way.
Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
Diffstat (limited to 'openbsc/src/libmsc/ctrl_commands.c')
-rw-r--r-- | openbsc/src/libmsc/ctrl_commands.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index 79e136d52..d153247b0 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -20,6 +20,7 @@ */ #include <osmocom/ctrl/control_cmd.h> +#include <osmocom/core/utils.h> #include <openbsc/gsm_data.h> #include <openbsc/gsm_subscriber.h> #include <openbsc/db.h> @@ -103,8 +104,7 @@ static int set_subscriber_modify(struct ctrl_cmd *cmd, void *data) goto fail; subscr->authorized = 1; - strncpy(subscr->extension, msisdn, GSM_EXTENSION_LENGTH - 1); - subscr->extension[GSM_EXTENSION_LENGTH-1] = '\0'; + osmo_strlcpy(subscr->extension, msisdn, sizeof(subscr->extension)); /* put it back to the db */ rc = db_sync_subscriber(subscr); |