diff options
Diffstat (limited to 'xmpp.c')
-rw-r--r-- | xmpp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -161,10 +161,12 @@ int xmpp_connect(void) { printf("net_init()\n"); + int sock = -1; + char *jid; char *pwd; if (!get_credentials(&jid, &pwd)) { - return -1; + return sock; } printf("Trying to connect as '%s' with '%s'.\n", jid, pwd); @@ -173,7 +175,7 @@ int xmpp_connect(void) struct addrinfo *addr = resolve_dns(domain); - int sock = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); + sock = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); if (sock == -1) { printf("Failed to get socket from OS!."); return sock; |