diff options
author | Youngjae Cho <y0.cho@samsung.com> | 2019-12-30 11:06:15 +0900 |
---|---|---|
committer | Youngjae Cho <y0.cho@samsung.com> | 2019-12-30 16:36:40 +0900 |
commit | 30b7edc79749e0ed784e45de128c50494de5446e (patch) | |
tree | b2a5e9a63927374a38c7bdd8d2c509722d8e89ef | |
parent | 6fa9f19ab8e8d0b9fb4f554fea8116acc08ac566 (diff) | |
download | device-manager-plugin-emul-30b7edc79749e0ed784e45de128c50494de5446e.tar.gz device-manager-plugin-emul-30b7edc79749e0ed784e45de128c50494de5446e.tar.bz2 device-manager-plugin-emul-30b7edc79749e0ed784e45de128c50494de5446e.zip |
Remove 'stringop-truncation' warning for GCC-9submit/tizen/20200107.064832submit/tizen/20200107.014443accepted/tizen/unified/20200108.131618
Change-Id: I5f5d364ec1245300705be1364291121511aa81cd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r-- | src/device_manager_io.c | 3 | ||||
-rw-r--r-- | src/device_manager_plugin_emul.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/device_manager_io.c b/src/device_manager_io.c index 717ecd5..3e527c1 100644 --- a/src/device_manager_io.c +++ b/src/device_manager_io.c @@ -156,7 +156,8 @@ int sys_get_str(char *fname, char* str) char buf[BUFF_MAX] = {0}; if (sys_read_buf(fname, buf) == 0) { - strncpy(str, buf, strlen(buf)); + memset(str, 0, strlen(buf) + 1); + memcpy(str, buf, strlen(buf)); return 0; } diff --git a/src/device_manager_plugin_emul.c b/src/device_manager_plugin_emul.c index 6f0e226..07e3d43 100644 --- a/src/device_manager_plugin_emul.c +++ b/src/device_manager_plugin_emul.c @@ -264,7 +264,7 @@ static int OEM_sys_display_info(struct display_info *disp_info) if (!strncmp(".", dent->d_name, sizeof(".")) || !strncmp("..", dent->d_name, sizeof(".."))) continue; else { - strncpy(disp_info[index].bl_name, dent->d_name, sizeof(disp_info[index].bl_name) - 1); + memcpy(disp_info[index].bl_name, dent->d_name, sizeof(disp_info[index].bl_name) - 1); index++; } } @@ -287,7 +287,7 @@ static int OEM_sys_display_info(struct display_info *disp_info) if (!strncmp(".", dent->d_name, sizeof(".")) || !strncmp("..", dent->d_name, sizeof(".."))) continue; else { - strncpy(disp_info[index].lcd_name, dent->d_name, sizeof(disp_info[index].lcd_name) - 1); + memcpy(disp_info[index].lcd_name, dent->d_name, sizeof(disp_info[index].lcd_name) - 1); index++; } } |