From 676e8fc1ba927dc84df82b508d796e31d9fd120c Mon Sep 17 00:00:00 2001 From: Felix Herrmann Date: Mon, 13 Jan 2020 10:40:25 +0100 Subject: fix some gcc9 compiler warnings Many stringop-truncation and stringop-overflow warnings are still there (so many). https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ Signed-off-by: Felix Herrmann Signed-off-by: KHANH LUONG HONG DUY --- src/daemon/dlt_daemon_offline_logstorage.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/daemon/dlt_daemon_offline_logstorage.c') diff --git a/src/daemon/dlt_daemon_offline_logstorage.c b/src/daemon/dlt_daemon_offline_logstorage.c index 4e9c6c6..0b3c14f 100644 --- a/src/daemon/dlt_daemon_offline_logstorage.c +++ b/src/daemon/dlt_daemon_offline_logstorage.c @@ -49,9 +49,9 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid(char *key, if ((len > (DLT_ID_SIZE + 2)) || (len < 2)) return DLT_RETURN_ERROR; - strncpy(ecuid, key, (len - 2)); - strncpy(apid, ".*", 2); - strncpy(ctid, ".*", 2); + memcpy(ecuid, key, (len - 2)); + memcpy(apid, ".*", 2); + memcpy(ctid, ".*", 2); return DLT_RETURN_OK; } @@ -76,7 +76,7 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ctid(char *key, return DLT_RETURN_ERROR; strncpy(ctid, (key + 2), (len - 1)); - strncpy(apid, ".*", 2); + memcpy(apid, ".*", 2); return DLT_RETURN_OK; } @@ -101,7 +101,7 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_apid(char *key, return DLT_RETURN_ERROR; strncpy(apid, key + 1, (len - 2)); - strncpy(ctid, ".*", 2); + memcpy(ctid, ".*", 2); return DLT_RETURN_OK; } @@ -183,7 +183,7 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid_apid(char *key, else return DLT_RETURN_ERROR; - strncpy(ctid, ".*", 2); + memcpy(ctid, ".*", 2); return DLT_RETURN_OK; } @@ -227,7 +227,7 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_multi(char *key, if (tok != NULL) strncpy(ctid, tok, DLT_ID_SIZE); - strncpy(apid, ".*", 2); + memcpy(apid, ".*", 2); } else { strncpy(ecuid, tok, DLT_ID_SIZE); -- cgit v1.2.1