Cleanup: replace strncpy with BLI_strncpy
Also replace strncpy+strcat with BLI_string_join
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user