Fix undefined HOST_NAME_MAX on Windows.

The Windows build was broken by commit
826ad11e41 which introduced a dependency
on the HOST_NAME_MAX macro, which is not defined on Windows. According
to MSDN for gethostname(), the maximum length of the returned string
is 256 bytes (including the terminating null byte), so let's use that
as a fallback.
This commit is contained in:
Etienne Dechamps 2014-08-31 13:59:30 +01:00
parent 0f09260b13
commit 9ad656b512

View file

@ -191,6 +191,11 @@ bool check_id(const char *id) {
return true;
}
/* Windows doesn't define HOST_NAME_MAX. */
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 255
#endif
char *replace_name(const char *name) {
char *ret_name;