@@ -884,21 +884,17 @@ void CodeHeapAnalyticsDCmd::execute(DCmdSource source, TRAPS) {
884884EventLogDCmd::EventLogDCmd (outputStream* output, bool heap) :
885885 DCmdWithParser(output, heap),
886886 _log(" log" , " Name of log to be printed. If omitted, all logs are printed." , " STRING" , false , nullptr ),
887- _max(" max" , " Maximum number of events to be printed (newest first). If omitted, all events are printed." , " STRING " , false , nullptr )
887+ _max(" max" , " Maximum number of events to be printed (newest first). If omitted or zero , all events are printed." , " INT " , false , " 0 " )
888888{
889889 _dcmdparser.add_dcmd_option (&_log);
890890 _dcmdparser.add_dcmd_option (&_max);
891891}
892892
893893void EventLogDCmd::execute (DCmdSource source, TRAPS) {
894- const char * max_value = _max.value ();
895- int max = -1 ;
896- if (max_value != nullptr ) {
897- char * endptr = nullptr ;
898- if (!parse_integer (max_value, &max)) {
899- output ()->print_cr (" Invalid max option: \" %s\" ." , max_value);
900- return ;
901- }
894+ int max = (int )_max.value ();
895+ if (max < 0 ) {
896+ output ()->print_cr (" Invalid max option: \" %d\" ." , max);
897+ return ;
902898 }
903899 const char * log_name = _log.value ();
904900 if (log_name != nullptr ) {
0 commit comments