changeset: 55:e2cdf5870c7a
tag: tip
user: Nico Golde <nion_AT_suckless.org>
date: Sat Feb 03 13:36:39 2007 +0100
files: ii.c
description:
small adjustments
diff -r 9d7ba31de08c -r e2cdf5870c7a ii.c
--- a/ii.c Sat Feb 03 13:10:12 2007 +0100
+++ b/ii.c Sat Feb 03 13:36:39 2007 +0100
@@ -37,8 +37,9 @@ struct Channel {
Channel *next;
};
+#define PING_TIMEOUT 300
+#define SERVER_PORT 6667
static int irc;
-#define PING_TIMEOUT 300
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]) {
Received on Sat Feb 03 2007 - 13:40:02 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:54:51 UTC