Assert that the names for VALUEs aren't numbers
authoraland <aland>
Wed, 2 Jun 2004 20:16:50 +0000 (20:16 +0000)
committeraland <aland>
Wed, 2 Jun 2004 20:16:50 +0000 (20:16 +0000)
src/lib/dict.c

index 09bcd97..7715900 100644 (file)
@@ -465,6 +465,16 @@ static int process_value(const char* fn, const int line, const char* data)
        else
                sscanf(valstr, "%i", &value);
 
+       /*
+        *      valuepair.c will get excited when creating attributes,
+        *      if it sees values which look like integers, so we can't
+        *      use them here.
+        */
+       if (isdigit(*namestr)) {
+               librad_log("dict_init: %s[%d]: Names for VALUEs cannot start with a digit.",
+                          fn, line);
+       }
+
        if (dict_addvalue(namestr, attrstr, value) < 0) {
                librad_log("dict_init: %s[%d]: %s",
                           fn, line, librad_errstr);