]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/breakpoint.c
"enable count" user input error handling (PR gdb/15678)
[thirdparty/binutils-gdb.git] / gdb / breakpoint.c
index af0c2cfcda8886af45c91cdfe8fb4b6f01fca7b6..2804453060acb5f8d3a7da9086140cc00ab76429 100644 (file)
@@ -14880,7 +14880,7 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *,
   int match;
   struct get_number_or_range_state state;
 
-  if (args == 0)
+  if (args == 0 || *args == '\0')
     error_no_arg (_("one or more breakpoint numbers"));
 
   init_number_or_range (&state, args);
@@ -15217,7 +15217,12 @@ do_map_enable_count_breakpoint (struct breakpoint *bpt, void *countptr)
 static void
 enable_count_command (char *args, int from_tty)
 {
-  int count = get_number (&args);
+  int count;
+
+  if (args == NULL)
+    error_no_arg (_("hit count"));
+
+  count = get_number (&args);
 
   map_breakpoint_numbers (args, do_map_enable_count_breakpoint, &count);
 }