diff options
author | Aleksandar Ristovski <aristovski@qnx.com> | 2008-03-28 19:52:23 +0000 |
---|---|---|
committer | Aleksandar Ristovski <aristovski@qnx.com> | 2008-03-28 19:52:23 +0000 |
commit | c836824f3856e27fc85f47b7483c77254202540d (patch) | |
tree | f53459cc6f5911eb51f17e25e60f5837fc67734e /gdb/cp-support.c | |
parent | 25755480bfe55557584a51402beb0d7d3dd0261b (diff) | |
download | gdb-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.c | 10 |
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'; |