aboutsummaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-04-07 17:40:55 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-04-07 17:40:55 +0000
commitf635bd474c852542653ae5fc832ac7cc6886f222 (patch)
treef5c52658ae1f02367c70442301cf9ab1ec806f92 /gdb/xcoffread.c
parent73d0fc782010af6ad1784c9e3a8fc41997ec922b (diff)
downloadgdb-f635bd474c852542653ae5fc832ac7cc6886f222.zip
gdb-f635bd474c852542653ae5fc832ac7cc6886f222.tar.gz
gdb-f635bd474c852542653ae5fc832ac7cc6886f222.tar.bz2
use E_SYMNMLEN
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 443b19f..6d1606b 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1064,13 +1064,14 @@ read_xcoff_symtab (objfile, nsyms)
pointed to by cs->c_name will persist throughout xcoffread. If
we use the new field, it gets overwritten for each symbol. */
cs->c_name = ((struct external_syment *)raw_symbol)->e.e_name;
- /* If it's exactly 8 characters long it isn't '\0'-terminated. */
- if (cs->c_name[7] != '\0')
+ /* If it's exactly E_SYMNMLEN characters long it isn't
+ '\0'-terminated. */
+ if (cs->c_name[E_SYMNMLEN - 1] != '\0')
{
char *p;
- p = obstack_alloc (&objfile->symbol_obstack, 9);
- strncpy (p, cs->c_name, 8);
- p[8] = '\0';
+ p = obstack_alloc (&objfile->symbol_obstack, E_SYMNMLEN + 1);
+ strncpy (p, cs->c_name, E_SYMNMLEN);
+ p[E_SYMNMLEN] = '\0';
cs->c_name = p;
symname_alloced = 1;
}