From 8cb3b49e51469b9689bfa44b85349149e17699dc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 10 Sep 2022 16:51:15 +1000 Subject: Cleanup: replace strncpy with BLI_strncpy Also replace strncpy+strcat with BLI_string_join --- source/blender/blenlib/intern/system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c index 781b38f713a..f7249e491d7 100644 --- a/source/blender/blenlib/intern/system.c +++ b/source/blender/blenlib/intern/system.c @@ -154,12 +154,12 @@ void BLI_hostname_get(char *buffer, size_t bufsize) if (gethostname(buffer, bufsize - 1) < 0) { BLI_strncpy(buffer, "-unknown-", bufsize); } - /* When gethostname() truncates, it doesn't guarantee the trailing \0. */ + /* When `gethostname()` truncates, it doesn't guarantee the trailing `\0`. */ buffer[bufsize - 1] = '\0'; #else DWORD bufsize_inout = bufsize; if (!GetComputerName(buffer, &bufsize_inout)) { - strncpy(buffer, "-unknown-", bufsize); + BLI_strncpy(buffer, "-unknown-", bufsize); } #endif } -- cgit v1.2.3