(OSX) Fix frontend_darwin_get_name

This commit is contained in:
Twinaphex 2016-01-13 20:32:42 +01:00
parent 4461ff8442
commit f1923f9a84

View File

@ -293,7 +293,9 @@ static void frontend_darwin_get_name(char *s, size_t len)
strlcpy(s, buffer.machine, len);
#elif defined(OSX)
size_t length = 0;
sysctlbyname("hw.model", s, &length, NULL, 0);
sysctlbyname("hw.model", NULL, &length, NULL, 0);
if (length)
sysctlbyname("hw.model", s, &length, NULL, 0);
#endif
}