Fix nick length check in is_valid_nick().
authorMichael Poole <mdpoole@troilus.org>
Wed, 10 Nov 2004 01:25:53 +0000 (01:25 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 10 Nov 2004 01:25:53 +0000 (01:25 +0000)
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

ChangeLog
src/proto-p10.c

index b577fd0375dd482f4576e471bfed0c67548ff419..43fe2e303e30f5226313fd9a8a422b13ed8b9273 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,20 @@
 # 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:
index 37eb33445040081cdd174fd3bed899005419d21a..65eec3a009d0325d8025b786eeaadb50412dac05 100644 (file)
@@ -1847,12 +1847,13 @@ AddClone(const char *nick, const char *ident, const char *hostname, const char *
 
 int
 is_valid_nick(const char *nick) {
+    unsigned int ii;
     /* 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;