aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-05-25 19:17:07 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-05-25 19:17:07 +0200
commit5da6fcc0481804a3c7a539c5e925abed9e6f1ab8 (patch)
tree85b000093f095458c2da17d56c353de4a89170a1
parentb3b426369b56ce64527d2fed9bda880a25441931 (diff)
downloadexternal_libsamsung-ipc-5da6fcc0481804a3c7a539c5e925abed9e6f1ab8.zip
external_libsamsung-ipc-5da6fcc0481804a3c7a539c5e925abed9e6f1ab8.tar.gz
external_libsamsung-ipc-5da6fcc0481804a3c7a539c5e925abed9e6f1ab8.tar.bz2
net: Proper PLMN copy, without null terminating byte
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--samsung-ipc/net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samsung-ipc/net.c b/samsung-ipc/net.c
index 2d04bc8..0597c42 100644
--- a/samsung-ipc/net.c
+++ b/samsung-ipc/net.c
@@ -41,11 +41,11 @@ int ipc_net_plmn_sel_setup(struct ipc_net_plmn_sel_request_data *data,
if (plmn_length > sizeof(data->plmn))
plmn_length = sizeof(data->plmn);
- strncpy((char *) data->plmn, plmn, plmn_length);
+ memcpy((void *) data->plmn, (void *) plmn, plmn_length);
// If there are less (5 is the usual case) PLMN bytes, fill the rest with '#'
if (plmn_length < sizeof(data->plmn))
- memset(data->plmn + plmn_length, '#', sizeof(data->plmn) - plmn_length);
+ memset((void *) ((unsigned char *) data->plmn + plmn_length), '#', sizeof(data->plmn) - plmn_length);
data->act = act;
}