ii

irc it, simple FIFO based irc client
git clone git://git.suckless.org/ii
Log | Files | Refs | README | LICENSE

commit 4fcd8047d21081424b05ec9226a87c6ec3d213a2
parent 71bda09b276b578de8992d1c9b2603f6482c3206
Author: Nico Golde <nion@suckless.org>
Date:   Sat,  3 Feb 2007 13:36:39 +0100

small adjustments
Diffstat:
Mii.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ii.c b/ii.c @@ -37,8 +37,9 @@ struct Channel { Channel *next; }; -static int irc; #define PING_TIMEOUT 300 +#define SERVER_PORT 6667 +static int irc; static time_t last_response; static Channel *channels = nil; static char *host = "irc.freenode.net"; @@ -458,7 +459,7 @@ static void run() { int main(int argc, char *argv[]) { int i; - unsigned short port = 6667; + unsigned short port = SERVER_PORT; struct passwd *spw = getpwuid(getuid()); char *key = nil; char prefix[_POSIX_PATH_MAX]; @@ -470,9 +471,7 @@ int main(int argc, char *argv[]) { } snprintf(nick, sizeof(nick), "%s", spw->pw_name); snprintf(prefix, sizeof(prefix),"%s/irc", spw->pw_dir); - - if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h') - usage(); + if (argc <= 1 || (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h')) usage(); for(i = 1; (i + 1 < argc) && (argv[i][0] == '-'); i++) { switch (argv[i][1]) {