From d78a5ac02ea35399101fb53d12a25f96be4c112d Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 9 Jan 2023 18:20:36 +0100 Subject: Make return statement more consistent --- xmpp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmpp.c b/xmpp.c index c718df4..18bb6c5 100644 --- a/xmpp.c +++ b/xmpp.c @@ -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; -- cgit v1.2.3-70-g09d2