diff --git a/Makefile b/Makefile index 7236d15..82d651a 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ OBJECT=build AYAS=ayaya ETC=etc INCLUDES=src/include -CC=cc +CC ?=cc CFLAGS=-I$(SOURCE) -I$(INCLUDES) -I$(CYTO_INC) -DNAME="\"$(NAME)\"" -DVERSION="\"$(VERSION)\"" -DREPOSITORY=\"$(REPOSITORY)\" -DCODE=\"$(CODE)\" -O3 -g -Wall -Werror LDFLAGS=-L $(CYTO_LIB) -lCytoplasm -O3 -g AFLAGS=-C "$(ETC)/ayadoc/style.css" -p "$(NAME)" diff --git a/src/Command/Parser.c b/src/Command/Parser.c index 6ff55d3..2101254 100644 --- a/src/Command/Parser.c +++ b/src/Command/Parser.c @@ -49,7 +49,7 @@ CommandParse(char *cmd) char c = *cur; char *tmp; bool type; - char char_type; + char char_type = '\0'; switch (state) { case STATE_WHITE: diff --git a/src/Parsee/Utils/Formatting.c b/src/Parsee/Utils/Formatting.c index e538abc..4e89aec 100644 --- a/src/Parsee/Utils/Formatting.c +++ b/src/Parsee/Utils/Formatting.c @@ -37,7 +37,9 @@ XMPPifyElement(HashMap *event, XMLElement *elem, XMPPFlags flags) size_t len = strp ? strlen(strp) : 0; \ for (cidx = 0; cidx < len; cidx++) \ { \ - char cch[2] = { strp[cidx], 0 }; \ + char cch[2]; \ + cch[0] = strp[cidx]; \ + cch[1] = '\0'; \ char nch = *cch ? strp[cidx+1] : '\0'; \ bool c = *cch == '\n' && nch != '>'; \ if (c && flags.quote) \ diff --git a/src/XMPP/Component.c b/src/XMPP/Component.c index c44d14b..d646436 100644 --- a/src/XMPP/Component.c +++ b/src/XMPP/Component.c @@ -33,6 +33,15 @@ XMPPInitialiseCompStream(char *host, int port) hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(host, serv, &hints, &res0); + if (error) + { + const char *error_str = gai_strerror(error); + Log(LOG_ERR, + "%s: cannot connect to '%s': %s", __func__, + host, error_str + ); + return NULL; + } for (res = res0; res; res = res->ai_next) {