From d9863ca8dcf06795f734e8517b9fcbc80b1f6b85 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sun, 13 May 2018 20:25:33 +0900 Subject: [PATCH] Replace strncpy with strlcpy Replace strncpy with strlcpy, since destination size equals maximum number of characters to copy. Pointed by gcc8 [-Werror=stringop-truncation] Change-Id: I528a35bd071b1d13f16dcec2e8c2007b5bb072b2 Reviewed-on: https://review.haiku-os.org/473 Reviewed-by: waddlesplash --- src/apps/aboutsystem/AboutSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index 72439db87a..78df90d618 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -1581,7 +1581,7 @@ MemSizeToString(char string[], size_t size, system_info* info) snprintf(string, size, "%d", inaccessibleMemory); message.ReplaceFirst("%inaccessible", string); - strncpy(string, message.String(), size); + strlcpy(string, message.String(), size); } else { snprintf(string, size, B_TRANSLATE("%d MiB total"), int(info->max_pages * (B_PAGE_SIZE / 1048576.0f) + 0.5f));