Title: fix computer name being trancated sometime

This commit is contained in:
李通洲
2023-01-10 20:56:54 +08:00
parent ef2a5110fe
commit c6365755c7
+1 -1
View File
@@ -13,7 +13,7 @@ static int detectSysname(struct utsname *name)
static int detectNodename(struct utsname *name)
{
DWORD bufSize = UTSNAME_MAXLENGTH - 1;
if(!GetComputerNameA(name->nodename, &bufSize))
if(!GetComputerNameExA(ComputerNameDnsFullyQualified, name->nodename, &bufSize))
return 1;
name->nodename[bufSize] = '\0';
return 0;