hotspot/src/share/vm/services/writeableFlags.cpp
changeset 38942 a4b3fc1ba095
parent 33604 ad1cd9269bd4
child 46630 75aa3e39d02c
--- a/hotspot/src/share/vm/services/writeableFlags.cpp	Fri Jun 03 16:19:53 2016 +0000
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp	Fri Jun 03 13:26:43 2016 -0500
@@ -93,12 +93,12 @@
 
 // set a boolean global flag
 Flag::Error WriteableFlags::set_bool_flag(const char* name, const char* arg, Flag::Flags origin, FormatBuffer<80>& err_msg) {
-  int value = true;
-
-  if (sscanf(arg, "%d", &value)) {
-    return set_bool_flag(name, value != 0, origin, err_msg);
+  if ((strcasecmp(arg, "true") == 0) || (*arg == '1' && *(arg + 1) == 0)) {
+    return set_bool_flag(name, true, origin, err_msg);
+  } else if ((strcasecmp(arg, "false") == 0) || (*arg == '0' && *(arg + 1) == 0)) {
+    return set_bool_flag(name, false, origin, err_msg);
   }
-  err_msg.print("flag value must be a boolean (1 or 0)");
+  err_msg.print("flag value must be a boolean (1/0 or true/false)");
   return Flag::WRONG_FORMAT;
 }