ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/s_user.c
(Generate patch)

Comparing ircd-hybrid-8/src/s_user.c (file contents):
Revision 1164 by michael, Wed Aug 10 19:46:00 2011 UTC vs.
Revision 1165 by michael, Thu Aug 11 18:56:53 2011 UTC

# Line 676 | Line 676 | valid_username(const char *username)
676    return 1;
677   }
678  
679 + /* clean_nick_name()
680 + *
681 + * input        - nickname
682 + *              - whether it's a local nick (1) or remote (0)
683 + * output       - none
684 + * side effects - walks through the nickname, returning 0 if erroneous
685 + */
686 + int
687 + valid_nickname(const char *nickname, const int local)
688 + {
689 +  const char *p = nickname;
690 +  assert(nickname && *nickname);
691 +
692 +  /* nicks can't start with a digit or - or be 0 length */
693 +  /* This closer duplicates behaviour of hybrid-6 */
694 +  if (*p == '-' || (IsDigit(*p) && local) || *p == '\0')
695 +    return 0;
696 +
697 +  for (; *p; ++p)
698 +    if (!IsNickChar(*p))
699 +      return 0;
700 +
701 +  return p - nickname <= (NICKLEN - 1);
702 + }
703 +
704   /* report_and_set_user_flags()
705   *
706   * inputs       - pointer to source_p

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)