mirror of
https://github.com/Tiiffi/mcrcon.git
synced 2025-10-27 11:21:07 -04:00
Changes per feedback on #16
This commit is contained in:
6
Makefile
6
Makefile
@ -1,4 +1,4 @@
|
|||||||
# if you want to cross compile
|
# if you want to cross compile
|
||||||
# export PATH=$PATH:/path/to/compiler/bin
|
# export PATH=$PATH:/path/to/compiler/bin
|
||||||
# export CROSS_COMPILE=arm-none-linux-gnueabi-
|
# export CROSS_COMPILE=arm-none-linux-gnueabi-
|
||||||
# make
|
# make
|
||||||
@ -6,10 +6,8 @@
|
|||||||
EXENAME = mcrcon
|
EXENAME = mcrcon
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os -s
|
|
||||||
EXTRAFLAGS ?= -fstack-protector-strong
|
EXTRAFLAGS ?= -fstack-protector-strong
|
||||||
|
|
||||||
CC ?= gcc
|
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
LINKER =
|
LINKER =
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
@ -23,6 +21,8 @@ endif
|
|||||||
ifeq ($(shell uname), Darwin)
|
ifeq ($(shell uname), Darwin)
|
||||||
INSTALL = ginstall
|
INSTALL = ginstall
|
||||||
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os
|
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os
|
||||||
|
else
|
||||||
|
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os -s
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|||||||
3
mcrcon.c
3
mcrcon.c
@ -304,9 +304,10 @@ int net_connect(const char *host, const char *port)
|
|||||||
{
|
{
|
||||||
int sd;
|
int sd;
|
||||||
|
|
||||||
struct addrinfo hints = {.ai_family = 0};
|
struct addrinfo hints;
|
||||||
struct addrinfo *server_info, *p;
|
struct addrinfo *server_info, *p;
|
||||||
|
|
||||||
|
memset(&hints, 0, sizeof hints);
|
||||||
hints.ai_family = AF_UNSPEC;
|
hints.ai_family = AF_UNSPEC;
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
hints.ai_protocol = IPPROTO_TCP;
|
hints.ai_protocol = IPPROTO_TCP;
|
||||||
|
|||||||
Reference in New Issue
Block a user