Jinoh Kang (@iamahuman) commented about programs/wineboot/wineboot.c:
/* create the ComputerName registry keys */ static void create_computer_name_keys(void) {
- struct addrinfo hints = {0}, *res;
static const struct addrinfo hints = { .ai_flags = AI_CANONNAME };
struct addrinfo *res = NULL; char *dot, buffer[256], *name = buffer; HKEY key, subkey;
if (gethostname( buffer, sizeof(buffer) )) return;
- hints.ai_flags = AI_CANONNAME; if (!getaddrinfo( buffer, NULL, &hints, &res ) && res->ai_canonname && strcasecmp(res->ai_canonname, "localhost") != 0)
I think we should avoid assuming the function leaves the out variable untouched on failure. Also, let's take this opportunity to split the condition:
```suggestion:-0+0 if (getaddrinfo( buffer, NULL, &hints, &res )) res = NULL; else if (strcasecmp(res->ai_canonname, "localhost") != 0) ```
(I removed the NULL check for ai_canonname, seems it's set to eqal nodename rather than set to NULL.)