use E_SYMNMLEN
authorJim Kingdon <jkingdon@engr.sgi.com>
Wed, 7 Apr 1993 17:40:55 +0000 (17:40 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Wed, 7 Apr 1993 17:40:55 +0000 (17:40 +0000)
gdb/ChangeLog
gdb/xcoffread.c

index 2eec88fa97340ded2829f97e2f3de0441cac7a1e..6fb8f2da785d23f8c5040eb32425184ec0441cee 100644 (file)
@@ -1,3 +1,7 @@
+Wed Apr  7 10:11:22 1993  Jim Kingdon  (kingdon@cygnus.com)
+
+       * xcoffread.c (read_xcoff_symtab): Use E_SYMNMLEN.
+
 Tue Apr  6 22:30:58 1993  K. Richard Pixley  (rich@cygnus.com)
 
        Add section table to objfile struct.  Use it for find_pc_section.
index 443b19f58a393163f45381618be2452da19fb879..6d1606b93b01bef9b24b55264d96799e8436d06d 100644 (file)
@@ -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;
          }