Commit 53504016 by Stu Grossman Committed by Jeff Law

cplus-dem.c (demangle_fund_type (near 'I' case)): Don't advance the *mangled…

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
parent 51e2a951
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> 1999-05-13 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* tmpnam.c (L_tmpnam): Fix typo. * tmpnam.c (L_tmpnam): Fix typo.
......
...@@ -51,6 +51,8 @@ char * realloc (); ...@@ -51,6 +51,8 @@ char * realloc ();
#include "libiberty.h" #include "libiberty.h"
#define min(X,Y) (((X) < (Y)) ? (X) : (Y))
static const char *mystrstr PARAMS ((const char *, const char *)); static const char *mystrstr PARAMS ((const char *, const char *));
static const char * static const char *
...@@ -3373,14 +3375,14 @@ demangle_fund_type (work, mangled, result) ...@@ -3373,14 +3375,14 @@ demangle_fund_type (work, mangled, result)
break; break;
} }
case 'I': case 'I':
++(*mangled); (*mangled)++;
if (**mangled == '_') if (**mangled == '_')
{ {
int i; int i;
++(*mangled); (*mangled)++;
for (i = 0; for (i = 0;
(i < sizeof (buf) - 1 && **mangled && **mangled != '_'); i < sizeof (buf) - 1 && **mangled && **mangled != '_';
++(*mangled), ++i) (*mangled)++, i++)
buf[i] = **mangled; buf[i] = **mangled;
if (**mangled != '_') if (**mangled != '_')
{ {
...@@ -3388,13 +3390,13 @@ demangle_fund_type (work, mangled, result) ...@@ -3388,13 +3390,13 @@ demangle_fund_type (work, mangled, result)
break; break;
} }
buf[i] = '\0'; buf[i] = '\0';
++(*mangled); (*mangled)++;
} }
else else
{ {
strncpy (buf, *mangled, 2); strncpy (buf, *mangled, 2);
buf[2] = '\0'; buf[2] = '\0';
*mangled += 2; *mangled += min (strlen (*mangled), 2);
} }
sscanf (buf, "%x", &dec); sscanf (buf, "%x", &dec);
sprintf (buf, "int%i_t", dec); sprintf (buf, "int%i_t", dec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment