diff options
Diffstat (limited to 'gcc/xcoffout.c')
-rw-r--r-- | gcc/xcoffout.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c index f79755a..a2d8a33 100644 --- a/gcc/xcoffout.c +++ b/gcc/xcoffout.c @@ -405,22 +405,18 @@ xcoffout_end_block (unsigned int line, unsigned int n) void xcoffout_declare_function (FILE *file, tree decl, const char *name) { - int i; + size_t len; if (*name == '*') name++; - else - for (i = 0; name[i]; ++i) - { - if (name[i] == '[') - { - char *n = alloca (i + 1); - strncpy (n, name, i); - n[i] = '\0'; - name = n; - break; - } - } + len = strlen (name); + if (name[len - 1] == ']') + { + char *n = alloca (len - 3); + strncpy (n, name, len - 4); + n[len - 4] = '\0'; + name = n; + } /* Any pending .bi or .ei must occur before the .function pseudo op. Otherwise debuggers will think that the function is in the previous |