[hackers] [sic] applied Quentin Carbonneaux's user patch || garbeam
changeset: 113:d71ab70738d9
tag: tip
user: garbeam_AT_gmail.com
date: Sun Jan 22 18:27:17 2012 +0100
files: sic.c
description:
applied Quentin Carbonneaux's user patch
diff -r cb3bfd46c84d -r d71ab70738d9 sic.c
--- a/sic.c Fri Apr 08 12:51:16 2011 +0000
+++ b/sic.c Sun Jan 22 18:27:17 2012 +0100
_AT_@ -138,7 +138,8 @@
const char *user = getenv("USER");
fd_set rd;
- strlcpy(nick, user ? user : "unknown", sizeof nick);
+ if (!user) user = "unknown";
+ strlcpy(nick, user, sizeof nick);
for(i = 1; i < argc; i++) {
c = argv[i][1];
if(argv[i][0] != '-' || argv[i][2])
_AT_@ -156,10 +157,13 @@
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");
default:
- eprint("usage: sic [-h host] [-p port] [-n nick] [-k keyword] [-v]\n");
+ eprint("usage: sic [-h host] [-p port] [-n nick] [-k keyword] [-u user] [-v]\n");
}
}
/* init */
_AT_@ -169,7 +173,7 @@
if(password)
sout("PASS %s", password);
sout("NICK %s", nick);
- sout("USER %s localhost %s :%s", nick, host, nick);
+ sout("USER %s localhost %s :%s", user, host, nick);
fflush(srv);
setbuf(stdout, NULL);
setbuf(srv, NULL);
Received on Sun Jan 22 2012 - 18:27:19 CET
This archive was generated by hypermail 2.3.0
: Sun Jan 22 2012 - 18:36:07 CET