Don't assume sa.sa_family is a short int.
[tinc] / src / utils.c
index db7a8cd..65ba4b9 100644 (file)
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#include "logger.h"
 #include "system.h"
-#include "xalloc.h"
-
-#include "../src/logger.h"
 #include "utils.h"
+#include "xalloc.h"
 
 static const char hexadecimals[] = "0123456789ABCDEF";
 static const char base64_original[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -192,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;