--- a/hotspot/src/share/vm/runtime/arguments.cpp Mon Aug 31 23:29:02 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Mon Aug 31 11:51:29 2015 -0700
@@ -581,8 +581,10 @@
}
static bool set_fp_numeric_flag(char* name, char* value, Flag::Flags origin) {
- double v;
- if (sscanf(value, "%lf", &v) != 1) {
+ char* end;
+ errno = 0;
+ double v = strtod(value, &end);
+ if ((errno != 0) || (*end != 0)) {
return false;
}
@@ -716,9 +718,9 @@
return set_string_flag(name, value, origin);
}
-#define SIGNED_FP_NUMBER_RANGE "[-0123456789.]"
+#define SIGNED_FP_NUMBER_RANGE "[-0123456789.eE+]"
#define SIGNED_NUMBER_RANGE "[-0123456789]"
-#define NUMBER_RANGE "[0123456789]"
+#define NUMBER_RANGE "[0123456789eE+-]"
char value[BUFLEN + 1];
char value2[BUFLEN + 1];
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) SIGNED_NUMBER_RANGE "." "%" XSTR(BUFLEN) NUMBER_RANGE "%c", name, value, value2, &dummy) == 3) {