]> diplodocus.org Git - nmh/blobdiff - sbr/seq_nameok.c
Deference char pointer to test for empty string instead of strlen(3).
[nmh] / sbr / seq_nameok.c
index 678ab5b53b93e382829ea3157916c193f64deedd..328bd5c2633027a5fb94efdf20b3a563815fdf26 100644 (file)
@@ -2,8 +2,6 @@
 /*
  * seq_nameok.c -- check if a sequence name is ok
  *
- * $Id$
- *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
@@ -13,9 +11,9 @@
 
 
 int
-seq_nameok (unsigned char *s)
+seq_nameok (char *s)
 {
-    unsigned char *pp;
+    char *pp;
 
     if (s == NULL || *s == '\0') {
        advise (NULL, "empty sequence name");
@@ -40,7 +38,7 @@ seq_nameok (unsigned char *s)
      * First character in a sequence name must be
      * an alphabetic character ...
      */
-    if (!isalpha (*s)) {
+    if (!isalpha ((unsigned char) *s)) {
        advise (NULL, "illegal sequence name: %s", s);
        return 0;
     }
@@ -49,7 +47,7 @@ seq_nameok (unsigned char *s)
      * and can be followed by zero or more alphanumeric characters
      */
     for (pp = s + 1; *pp; pp++)
-       if (!isalnum (*pp)) {
+       if (!isalnum ((unsigned char) *pp)) {
            advise (NULL, "illegal sequence name: %s", s);
            return 0;
        }