Changes per feedback on #16

This commit is contained in:
Dan Buch
2017-01-03 15:39:41 -05:00
parent 64c8c6ba16
commit 02ae39747e
2 changed files with 5 additions and 4 deletions

View File

@ -6,10 +6,8 @@
EXENAME = mcrcon
PREFIX ?= /usr/local
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os -s
EXTRAFLAGS ?= -fstack-protector-strong
CC ?= gcc
INSTALL = install
LINKER =
RM = rm -f
@ -23,6 +21,8 @@ endif
ifeq ($(shell uname), Darwin)
INSTALL = ginstall
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os
else
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os -s
endif
.PHONY: all

View File

@ -304,9 +304,10 @@ int net_connect(const char *host, const char *port)
{
int sd;
struct addrinfo hints = {.ai_family = 0};
struct addrinfo hints;
struct addrinfo *server_info, *p;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;