* dwarf2read.c (typename_concat): Don't segv if prefix or suffix
is NULL. Simplify obs == NULL case.
This commit is contained in:
parent
fff0886884
commit
6dd47d34c6
@ -1,3 +1,8 @@
|
||||
2008-10-24 Doug Evans <dje@google.com>
|
||||
|
||||
* dwarf2read.c (typename_concat): Don't segv if prefix or suffix
|
||||
is NULL. Simplify obs == NULL case.
|
||||
|
||||
2008-10-24 Hui Zhu <teawater@gmail.com>
|
||||
Pedro Alves <pedro@codesourcery.com>
|
||||
|
||||
|
@ -8081,19 +8081,17 @@ typename_concat (struct obstack *obs, const char *prefix, const char *suffix,
|
||||
else
|
||||
sep = "::";
|
||||
|
||||
if (prefix == NULL)
|
||||
prefix = "";
|
||||
if (suffix == NULL)
|
||||
suffix = "";
|
||||
|
||||
if (obs == NULL)
|
||||
{
|
||||
char *retval = xmalloc (strlen (prefix) + MAX_SEP_LEN + strlen (suffix) + 1);
|
||||
retval[0] = '\0';
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
strcpy (retval, prefix);
|
||||
strcat (retval, sep);
|
||||
}
|
||||
if (suffix)
|
||||
strcat (retval, suffix);
|
||||
|
||||
strcpy (retval, prefix);
|
||||
strcat (retval, sep);
|
||||
strcat (retval, suffix);
|
||||
return retval;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user