From 182bbafa0fd785395f239be615f9e31ad38c47e9 Mon Sep 17 00:00:00 2001 From: aland Date: Sat, 27 May 2006 00:17:22 +0000 Subject: [PATCH] Be a little smarter about allowing VALUE names that start with digits. It turns out there's a bunch of these in the dictionaries that haven't yet been caught, so being smarter here helps a lot. --- src/lib/valuepair.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/valuepair.c b/src/lib/valuepair.c index c8cfe25..acb8c6a 100644 --- a/src/lib/valuepair.c +++ b/src/lib/valuepair.c @@ -773,15 +773,14 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value) break; case PW_TYPE_INTEGER: /* - * If it starts with a digit, it must - * be a number (or a range). - * * Note that ALL integers are unsigned! */ - if (isdigit((int) *value)) { + if (isdigit((int) value[0]) && + (strspn(value, "0123456789") == strlen(value))) { vp->lvalue = (uint32_t) strtoul(value, NULL, 10); vp->length = 4; } + /* * Look for the named value for the given * attribute. -- 2.1.4