The for() loop in is_valid_nick() leaves 'nick' as an empty string,
which is obviosly shorter than the nick length limit. Fix that.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-83
# arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
#
# arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
#
+2004-11-10 01:25:53 GMT Michael Poole <mdpoole@troilus.org> patch-83
+
+ Summary:
+ Fix nick length check in is_valid_nick().
+ Revision:
+ srvx--devo--1.3--patch-83
+
+ The for() loop in is_valid_nick() leaves 'nick' as an empty string,
+ which is obviosly shorter than the nick length limit. Fix that.
+
+ modified files:
+ ChangeLog src/proto-p10.c
+
+
2004-10-16 21:14:11 GMT Michael Poole <mdpoole@troilus.org> patch-82
Summary:
2004-10-16 21:14:11 GMT Michael Poole <mdpoole@troilus.org> patch-82
Summary:
int
is_valid_nick(const char *nick) {
int
is_valid_nick(const char *nick) {
/* IRC has some of The Most Fucked-Up ideas about character sets
* in the world.. */
if (!isalpha(*nick) && !strchr("{|}~[\\]^_`", *nick))
return 0;
/* IRC has some of The Most Fucked-Up ideas about character sets
* in the world.. */
if (!isalpha(*nick) && !strchr("{|}~[\\]^_`", *nick))
return 0;
- for (++nick; *nick; ++nick)
- if (!isalnum(*nick) && !strchr("{|}~[\\]^-_`", *nick))
+ for (ii = 0; nick[ii]; ++ii)
+ if (!isalnum(nick[ii]) && !strchr("{|}~[\\]^-_`", nick[ii]))
return 0;
if (strlen(nick) > nicklen)
return 0;
return 0;
if (strlen(nick) > nicklen)
return 0;