]> git.pond.sub.org Git - empserver/commitdiff
Cleaned up check_nat_name() function
authorRon Koenderink <rkoenderink@yahoo.ca>
Tue, 6 Jan 2009 23:48:37 +0000 (17:48 -0600)
committerRon Koenderink <rkoenderink@yahoo.ca>
Tue, 6 Jan 2009 23:48:37 +0000 (17:48 -0600)
No functional changes.  Rename temp to p and nonb to allblank.

src/lib/subs/natsub.c

index 8374ccb9135faecb5d54bdd285dd9673ff805343..9fbac178a6e3f87d0be9a21728eab44d42317c24 100644 (file)
@@ -120,23 +120,23 @@ check_nat_name(char *cname)
 {
     struct natstr *natp;
     natid cn;
-    int nonb;
-    char *temp;
+    int allblank;
+    char *p;
 
     if (strlen(cname) >= sizeof(natp->nat_cnam)) {
        pr("Country name too long\n");
        return 0;
     }
 
-    nonb = 0;
-    for (temp = cname; *temp != '\0'; temp++) {
-       if (iscntrl(*temp)) {
+    allblank = 1;
+    for (p = cname; *p != '\0'; p++) {
+       if (iscntrl(*p)) {
            pr("No control characters allowed in country names!\n");
            return 0;
-       } else if (!isspace(*temp))
-           nonb = 1;
+       } else if (!isspace(*p))
+           allblank = 0;
     }
-    if (!nonb) {
+    if (allblank) {
        pr("Country name can't be all blank\n");
        return 0;
     }