diff options
author | xengineering <me@xengineering.eu> | 2023-01-09 18:20:36 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-01-09 18:20:36 +0100 |
commit | d78a5ac02ea35399101fb53d12a25f96be4c112d (patch) | |
tree | b3fba868a3b5595ec9b29b031350b8641d6c4f2e | |
parent | f42744c9284b8349d4b2b9c6e0d22ac7d36d7f7f (diff) | |
download | limox-d78a5ac02ea35399101fb53d12a25f96be4c112d.tar limox-d78a5ac02ea35399101fb53d12a25f96be4c112d.tar.zst limox-d78a5ac02ea35399101fb53d12a25f96be4c112d.zip |
Make return statement more consistent
-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; |