summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungjae Cho <y0.cho@samsung.com>2019-12-30 10:54:57 +0900
committerYoungjae Cho <y0.cho@samsung.com>2019-12-30 10:59:12 +0900
commit269140d42ac5b61f532f1d9cfbe0717d73f03c7a (patch)
treec185f24b946e7dc1f44c50f0763e74505833bc4e
parent4eff162ddee41a2db8f767b86eee76fcbad57fd7 (diff)
downloaddevice-tm1-269140d42ac5b61f532f1d9cfbe0717d73f03c7a.tar.gz
device-tm1-269140d42ac5b61f532f1d9cfbe0717d73f03c7a.tar.bz2
device-tm1-269140d42ac5b61f532f1d9cfbe0717d73f03c7a.zip
Remove compile warning for GCC-9
- format-truncation - stringop-overflow Change-Id: Id680e0649eee93846c041988967aff1bde84ba5f Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r--hw/board/board.c4
-rw-r--r--hw/external_connection/external_connection.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/hw/board/board.c b/hw/board/board.c
index 2cbc583..3d11a86 100644
--- a/hw/board/board.c
+++ b/hw/board/board.c
@@ -64,7 +64,7 @@ static int get_serialno_from_dat(void)
*q = '\0';
len = strlen(p) > DATA_BUFF_MAX-1 ? DATA_BUFF_MAX-1 : strlen(p);
- strncpy(info.serial, p, len);
+ memcpy(info.serial, p, len);
info.serial[len] = '\0';
info.serial_len = strlen(p);
@@ -102,7 +102,7 @@ static int get_serialno_from_cpuinfo(void)
*q = '\0';
len = strlen(p) > DATA_BUFF_MAX-1 ? DATA_BUFF_MAX-1 : strlen(p);
- strncpy(info.serial, p, len);
+ memcpy(info.serial, p, len);
info.serial[len] = '\0';
info.serial_len = strlen(p);
diff --git a/hw/external_connection/external_connection.c b/hw/external_connection/external_connection.c
index 24c7f1f..b79b88d 100644
--- a/hw/external_connection/external_connection.c
+++ b/hw/external_connection/external_connection.c
@@ -150,7 +150,7 @@ static int external_connection_get_current_state(
{
int ret, i;
struct connection_info info;
- char buf[8];
+ char buf[16];
if (!updated_cb)
return -EINVAL;