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/libbsc/bsc_rf_ctrl.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/libbsc/bsc_rf_ctrl.c')
-rw-r--r-- | openbsc/src/libbsc/bsc_rf_ctrl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/openbsc/src/libbsc/bsc_rf_ctrl.c index 0538482a1..59fac3503 100644 --- a/openbsc/src/libbsc/bsc_rf_ctrl.c +++ b/openbsc/src/libbsc/bsc_rf_ctrl.c @@ -451,8 +451,7 @@ static int rf_create_socket(struct osmo_bsc_rf *rf, const char *path) } local.sun_family = AF_UNIX; - strncpy(local.sun_path, path, sizeof(local.sun_path)); - local.sun_path[sizeof(local.sun_path) - 1] = '\0'; + osmo_strlcpy(local.sun_path, path, sizeof(local.sun_path)); unlink(local.sun_path); /* we use the same magic that X11 uses in Xtranssock.c for |