[hackers] [sic] reversed the -u switch || anselm
changeset: 114:9ad0d58ea20d
tag: tip
user: anselm_AT_garbe.us
date: Sun Feb 05 16:47:38 2012 +0100
files: LICENSE sic.c
description:
reversed the -u switch
diff -r d71ab70738d9 -r 9ad0d58ea20d LICENSE
--- a/LICENSE Sun Jan 22 18:27:17 2012 +0100
+++ b/LICENSE Sun Feb 05 16:47:38 2012 +0100
_AT_@ -1,6 +1,6 @@
MIT/X Consortium License
-© 2005-2009 Anselm R Garbe <anselm_AT_garbe.us>
+© 2005-2012 Anselm R Garbe <anselm_AT_garbe.us>
© 2008-2009 Jeroen Schot <schot_AT_a-eskwadraat.nl>
© 2007-2009 Kris Maglione <maglione.k_AT_gmail.com>
© 2005 Nico Golde <nico at ngolde dot de>
diff -r d71ab70738d9 -r 9ad0d58ea20d sic.c
--- a/sic.c Sun Jan 22 18:27:17 2012 +0100
+++ b/sic.c Sun Feb 05 16:47:38 2012 +0100
_AT_@ -138,8 +138,7 @@
const char *user = getenv("USER");
fd_set rd;
- if (!user) user = "unknown";
- strlcpy(nick, user, sizeof nick);
+ strlcpy(nick, user ? user : "unknown", sizeof nick);
for(i = 1; i < argc; i++) {
c = argv[i][1];
if(argv[i][0] != '-' || argv[i][2])
_AT_@ -157,13 +156,10 @@
case 'k':
if(++i < argc) password = argv[i];
break;
- case 'u':
- if (++i < argc) user = argv[i];
- break;
case 'v':
- eprint("sic-"VERSION", © 2005-2009 Kris Maglione, Anselm R. Garbe, Nico Golde\n");
+ eprint("sic-"VERSION", © 2005-2012 Kris Maglione, Anselm R. Garbe, Nico Golde\n");
default:
- eprint("usage: sic [-h host] [-p port] [-n nick] [-k keyword] [-u user] [-v]\n");
+ eprint("usage: sic [-h host] [-p port] [-n nick] [-k keyword] [-v]\n");
}
}
/* init */
_AT_@ -173,7 +169,7 @@
if(password)
sout("PASS %s", password);
sout("NICK %s", nick);
- sout("USER %s localhost %s :%s", user, host, nick);
+ sout("USER %s localhost %s :%s", nick, host, nick);
fflush(srv);
setbuf(stdout, NULL);
setbuf(srv, NULL);
Received on Sun Feb 05 2012 - 16:47:35 CET
This archive was generated by hypermail 2.3.0
: Sun Feb 05 2012 - 16:48:17 CET