Cleanup: replace strncpy with BLI_strncpy

Also replace strncpy+strcat with BLI_string_join
This commit is contained in:
2022-09-10 16:51:15 +10:00
parent 489cb7fd7e
commit 8cb3b49e51
25 changed files with 36 additions and 36 deletions

View File

@@ -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
}