aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-support.c
diff options
context:
space:
mode:
authorAleksandar Ristovski <aristovski@qnx.com>2008-03-28 19:52:23 +0000
committerAleksandar Ristovski <aristovski@qnx.com>2008-03-28 19:52:23 +0000
commitc836824f3856e27fc85f47b7483c77254202540d (patch)
treef53459cc6f5911eb51f17e25e60f5837fc67734e /gdb/cp-support.c
parent25755480bfe55557584a51402beb0d7d3dd0261b (diff)
downloadgdb-c836824f3856e27fc85f47b7483c77254202540d.zip
gdb-c836824f3856e27fc85f47b7483c77254202540d.tar.gz
gdb-c836824f3856e27fc85f47b7483c77254202540d.tar.bz2
* cp-support.c (first_component_command): Return if no arguments.
Diffstat (limited to 'gdb/cp-support.c')
-rw-r--r--gdb/cp-support.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 5c610cc..696888e 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -892,8 +892,14 @@ maint_cplus_command (char *arg, int from_tty)
static void
first_component_command (char *arg, int from_tty)
{
- int len = cp_find_first_component (arg);
- char *prefix = alloca (len + 1);
+ int len;
+ char *prefix;
+
+ if (!arg)
+ return;
+
+ len = cp_find_first_component (arg);
+ prefix = alloca (len + 1);
memcpy (prefix, arg, len);
prefix[len] = '\0';