]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Added 0x... for numbers
authorAlan T. DeKok <aland@freeradius.org>
Sun, 3 Mar 2013 16:45:04 +0000 (11:45 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 5 Mar 2013 03:07:06 +0000 (22:07 -0500)
src/modules/rlm_expr/rlm_expr.c

index 801a0effe42929906e22961244e9966e1b5d5e29..5ddaea62f3db1a4e05df9e9433f9f2657eb41b30 100644 (file)
@@ -158,6 +158,15 @@ static int get_number(REQUEST *request, const char **string, int64_t *answer)
                         *
                         *  If it isn't, then we die.
                         */
+                       if ((*p == '0') && (p[1] == 'x')) {
+                               char *end;
+
+                               x = strtoul(p, &end, 16);
+                               p = end;
+                               goto calc;
+                       }
+
+
                        if ((*p < '0') || (*p > '9')) {
                                RDEBUG2("Not a number at \"%s\"", p);
                                return -1;
@@ -175,6 +184,7 @@ static int get_number(REQUEST *request, const char **string, int64_t *answer)
                        }
                }
 
+       calc:
                switch (this) {
                default:
                case TOKEN_NONE: