server_group: fix server group not working issue.

This commit is contained in:
Nick Peng
2022-08-11 00:57:09 +08:00
parent c156595f61
commit 2848aa0ac7
6 changed files with 139 additions and 54 deletions

View File

@@ -24,6 +24,15 @@
static inline char *safe_strncpy(char *dest, const char *src, size_t n)
{
if (src == NULL) {
dest[0] = '\0';
return dest;
}
if (n <= 0) {
return NULL;
}
#if __GNUC__ > 7
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"