From fcb1b5fdafbcf571a0d6c7f223d2f0db27497868 Mon Sep 17 00:00:00 2001 From: uriel Date: Thu, 8 Jun 2006 23:32:12 +0200 Subject: [PATCH] I suck, I suck and I suck; fuck vim; used ed to fix things up --- libixp/socket.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libixp/socket.c b/libixp/socket.c index 6f19101d..782bf8a9 100644 --- a/libixp/socket.c +++ b/libixp/socket.c @@ -72,20 +72,17 @@ connect_inet_sock(char *host) int ixp_connect_sock(char *address) { - char *p = strchr(address, '!'); - char *addr, *type; + char *p; + + if(p = strchr(address, '!')) { + *p = 0; + p++; - if(!p) - return -1; - *p = 0; - - addr = &p[1]; - type = address; /* unix, inet */ - - if(!strncmp(type, "unix", 5)) - return connect_unix_sock(addr); - else if(!strncmp(type, "tcp", 4)) - return connect_inet_sock(addr); + if(!strncmp(address, "unix", 5)) + return connect_unix_sock(p); + else if(!strncmp(address, "tcp", 4)) + return connect_inet_sock(p); + } return -1; }