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 | |
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')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/cp-support.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d36d4ce..75b9d93 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2008-03-19 Aleksandar Ristovski <aristovski@qnx.com> + + * cp-support.c (first_component_command): Return if no arguments. + 2008-03-28 Carlos O'Donell <carlos@codesourcery.com> * ser-mingw.c (ser_windows_open): Open requested name. 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'; |