cplus-dem.c (demangle_fund_type (near 'I' case)): Don't advance the *mangled pointer beyond the end of the string.

* cplus-dem.c (demangle_fund_type (near 'I' case)): Don't advance
        the *mangled pointer beyond the end of the string.  Clean up code to
        match prevailing coding style.

From-SVN: r26959
This commit is contained in:
Stu Grossman 1999-05-17 00:44:09 +00:00 committed by Jeff Law
parent 51e2a951cc
commit 53504016e1
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,9 @@
Mon May 17 01:42:34 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
* cplus-dem.c (demangle_fund_type (near 'I' case)): Don't advance
the *mangled pointer beyond the end of the string. Clean up code to
match prevailing coding style.
1999-05-13 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* tmpnam.c (L_tmpnam): Fix typo.

View file

@ -51,6 +51,8 @@ char * realloc ();
#include "libiberty.h"
#define min(X,Y) (((X) < (Y)) ? (X) : (Y))
static const char *mystrstr PARAMS ((const char *, const char *));
static const char *
@ -3373,14 +3375,14 @@ demangle_fund_type (work, mangled, result)
break;
}
case 'I':
++(*mangled);
(*mangled)++;
if (**mangled == '_')
{
int i;
++(*mangled);
(*mangled)++;
for (i = 0;
(i < sizeof (buf) - 1 && **mangled && **mangled != '_');
++(*mangled), ++i)
i < sizeof (buf) - 1 && **mangled && **mangled != '_';
(*mangled)++, i++)
buf[i] = **mangled;
if (**mangled != '_')
{
@ -3388,13 +3390,13 @@ demangle_fund_type (work, mangled, result)
break;
}
buf[i] = '\0';
++(*mangled);
(*mangled)++;
}
else
{
strncpy (buf, *mangled, 2);
buf[2] = '\0';
*mangled += 2;
*mangled += min (strlen (*mangled), 2);
}
sscanf (buf, "%x", &dec);
sprintf (buf, "int%i_t", dec);