home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / duucp-1.17 / AU-117b4-src.lha / src / lib / validuser.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-24  |  412 b   |  29 lines

  1. /*
  2.  *  VALIDUSER.C
  3.  *
  4.  *  (C) Copyright 1989-1990 by Matthew Dillon,    All Rights Reserved.
  5.  */
  6.  
  7. #include "stdio.h"
  8. #include "config.h"
  9.  
  10. Prototype int ValidUser (const char *);
  11.  
  12. int
  13. ValidUser (const char *str)
  14. {
  15.     register unsigned char
  16.         c;
  17.  
  18.     if (*str == '|' || *str == '@')
  19.         return 0;
  20.  
  21.     while (c = (unsigned char) *str) {
  22.         if ((c < 32 || c > 126) || c == ':' || c == '/')
  23.             return 0;
  24.         ++str;
  25.     }
  26.  
  27.     return 1;
  28. }
  29.