aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-utils.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-02-22 18:45:05 +0000
committerMichael Snyder <msnyder@vmware.com>2011-02-22 18:45:05 +0000
commit298f437a6b0631636cd55d72b8d98d862fc8c51e (patch)
treeca84f5d1093334090f2f76cc2a1a91266cd8ea17 /gdb/cli/cli-utils.c
parentb7ea3126c02915e913befc54ce6bebb6446efef6 (diff)
downloadgdb-298f437a6b0631636cd55d72b8d98d862fc8c51e.zip
gdb-298f437a6b0631636cd55d72b8d98d862fc8c51e.tar.gz
gdb-298f437a6b0631636cd55d72b8d98d862fc8c51e.tar.bz2
2011-02-22 Michael Snyder <msnyder@vmware.com>
* cli/cli-utils.c (number_is_in_list): Check for zero return.
Diffstat (limited to 'gdb/cli/cli-utils.c')
-rw-r--r--gdb/cli/cli-utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
index 8a7e5d4..34c368b 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/cli/cli-utils.c
@@ -175,10 +175,15 @@ number_is_in_list (char *list, int number)
if (list == NULL || *list == '\0')
return 1;
- while (list != NULL && *list != '\0')
- if (get_number_or_range (&list) == number)
- return 1;
+ while (*list != '\0')
+ {
+ int gotnum = get_number_or_range (&list);
+ if (gotnum == 0)
+ error (_("Args must be numbers or '$' variables."));
+ if (gotnum == number)
+ return 1;
+ }
return 0;
}