summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-01-09 18:20:36 +0100
committerxengineering <me@xengineering.eu>2023-01-09 18:20:36 +0100
commitd78a5ac02ea35399101fb53d12a25f96be4c112d (patch)
treeb3fba868a3b5595ec9b29b031350b8641d6c4f2e
parentf42744c9284b8349d4b2b9c6e0d22ac7d36d7f7f (diff)
downloadlimox-d78a5ac02ea35399101fb53d12a25f96be4c112d.tar
limox-d78a5ac02ea35399101fb53d12a25f96be4c112d.tar.zst
limox-d78a5ac02ea35399101fb53d12a25f96be4c112d.zip
Make return statement more consistent
-rw-r--r--xmpp.c6
1 files 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;