5 Commits
0.4 ... 0.6

3 changed files with 20 additions and 13 deletions

View File

@ -1,3 +1,5 @@
de32c537aaf66554894712563ffba8d9bc4c2714 0.1
56350a01f27753cfbdbb3dbc25f2a53dd4c2ac45 0.2
d77f00af559258679a0fad5d264685d663e6975a 0.3
a3549fb4c72ff0edb816c8c29be7ff289db5b003 0.4
70d49a37b35695f2f771bddaf309f05ea60af8bc 0.5

View File

@ -1,5 +1,5 @@
# sic version
VERSION = 0.4
VERSION = 0.6
# Customize below to fit your system

29
sic.c
View File

@ -49,7 +49,7 @@ pout(char *channel, char *msg) {
static char timestr[18];
time_t t = time(0);
strftime(timestr, sizeof(timestr), "%a %R", localtime(&t));
strftime(timestr, sizeof(timestr), "%F %R", localtime(&t));
fprintf(stdout, "%-8.8s: %s %s\n", channel, timestr, msg);
}
@ -232,16 +232,21 @@ main(int argc, char *argv[]) {
nick = fullname = getenv("USER");
for(i = 1; i < argc; i++)
if(!strncmp(argv[i], "-s", 3))
server = argv[++i];
else if(!strncmp(argv[i], "-p", 3))
port = (unsigned short)atoi(argv[++i]);
else if(!strncmp(argv[i], "-n", 3))
nick = argv[++i];
else if(!strncmp(argv[i], "-k", 3))
password = argv[++i];
else if(!strncmp(argv[i], "-f", 3))
fullname = argv[++i];
if(!strncmp(argv[i], "-s", 3)) {
if(++i < argc) server = argv[i];
}
else if(!strncmp(argv[i], "-p", 3)) {
if(++i < argc) port = (unsigned short)atoi(argv[i]);
}
else if(!strncmp(argv[i], "-n", 3)) {
if(++i < argc) nick = argv[i];
}
else if(!strncmp(argv[i], "-k", 3)) {
if(++i < argc) password = argv[i];
}
else if(!strncmp(argv[i], "-f", 3)) {
if(++i < argc) fullname = argv[i];
}
else if(!strncmp(argv[i], "-v", 3)) {
fputs("sic-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
exit(EXIT_SUCCESS);
@ -296,7 +301,7 @@ main(int argc, char *argv[]) {
exit(EXIT_FAILURE);
} else if(i == 0) {
if(time(NULL) - trespond >= PINGTIMEOUT) {
pout(server, "-!- sic shutting down: parseing timeout");
pout(server, "-!- sic shutting down: parse timeout");
exit(EXIT_FAILURE);
}
write(srv, ping, strlen(ping));