OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_ut_param.c versions 1.7 and 1.8
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_ut_param.c 1.7 -> 1.8

--- l2_ut_param.c        2002/01/02 17:07:38     1.7
+++ l2_ut_param.c        2002/07/29 17:42:25     1.8
@@ -126,7 +126,13 @@
         switch (pa[i].type) {
             case L2_TYPE_INT: {
                 /* integer parameter */
-                long val = strtol(cpB, &cpE, 10);
+                long val;
+                if (strlen(cpB) > 2 && cpB[0] == '0' && cpB[1] == 'x')
+                    val = strtol(cpB+2, &cpE, 16);
+                else if (strlen(cpB) > 1 && cpB[0] == '0')
+                    val = strtol(cpB+1, &cpE, 8);
+                else
+                    val = strtol(cpB, &cpE, 10);
                 if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE) {
                     l2_env_errorinfo(env, L2_ERR_ARG, 
                                      "numerical parameter value out of range "

CVSTrac 2.0.1