fix printable predicate
authorLuke Howard <lukeh@padl.com>
Tue, 21 Sep 2010 12:54:06 +0000 (14:54 +0200)
committerLuke Howard <lukeh@padl.com>
Tue, 21 Sep 2010 12:54:06 +0000 (14:54 +0200)
mech_eap/util_radius.cpp

index c9aec8d..8769650 100644 (file)
@@ -234,10 +234,17 @@ static bool
 isPrintableAttributeP(VALUE_PAIR *vp)
 {
     size_t i;
+    int gotChar = 0;
 
     for (i = 0; i < sizeof(vp->strvalue); i++) {
+        if (gotChar && vp->strvalue[i] == '\0')
+            return true;
+
         if (!isprint(vp->strvalue[i]))
             return false;
+
+        if (!gotChar)
+            gotChar++;
     }
 
     return true;