summaryrefslogtreecommitdiffstats
path: root/common/bbs/names.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/bbs/names.c')
-rw-r--r--common/bbs/names.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/bbs/names.c b/common/bbs/names.c
new file mode 100644
index 00000000..d96b3b3e
--- /dev/null
+++ b/common/bbs/names.c
@@ -0,0 +1,29 @@
+/* $Id$ */
+
+// #include "bbs.h"
+#include "cmbbs.h"
+#include <assert.h>
+// #include <stdio.h>
+// #include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+int
+is_validuserid(const char *id)
+{
+ int len, i;
+ if(id==NULL)
+ return 0;
+ len = strlen(id);
+
+ if (len < 2 || len>IDLEN)
+ return 0;
+
+ if (!isalpha(id[0]))
+ return 0;
+ for (i = 1; i < len; i++)
+ if (!isalnum(id[i]))
+ return 0;
+ return 1;
+}
+