hotspot/src/share/vm/runtime/arguments.cpp
changeset 20723 929cc8568f8e
parent 20408 ca559663042f
child 21099 46e6bbecd9e5
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Sat Oct 12 00:49:19 2013 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Mon Oct 14 14:21:34 2013 +0200
@@ -2694,8 +2694,9 @@
       FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
     // Xmaxf
     } else if (match_option(option, "-Xmaxf", &tail)) {
-      int maxf = (int)(atof(tail) * 100);
-      if (maxf < 0 || maxf > 100) {
+      char* err;
+      int maxf = (int)(strtod(tail, &err) * 100);
+      if (*err != '\0' || maxf < 0 || maxf > 100) {
         jio_fprintf(defaultStream::error_stream(),
                     "Bad max heap free percentage size: %s\n",
                     option->optionString);
@@ -2705,8 +2706,9 @@
       }
     // Xminf
     } else if (match_option(option, "-Xminf", &tail)) {
-      int minf = (int)(atof(tail) * 100);
-      if (minf < 0 || minf > 100) {
+      char* err;
+      int minf = (int)(strtod(tail, &err) * 100);
+      if (*err != '\0' || minf < 0 || minf > 100) {
         jio_fprintf(defaultStream::error_stream(),
                     "Bad min heap free percentage size: %s\n",
                     option->optionString);