diff options
author | Fred Fish <fnf@specifix.com> | 1993-05-30 00:03:59 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1993-05-30 00:03:59 +0000 |
commit | 86e3a5e40f5ea48d1f6a227fdbf3fdceaace84cf (patch) | |
tree | 58cfed21150b05b0471684cefd5a40b8d3ccc5f9 | |
parent | 69b2f0fe81dcaf544920f5cf33c04e2f491a8bd4 (diff) | |
download | binutils-86e3a5e40f5ea48d1f6a227fdbf3fdceaace84cf.zip binutils-86e3a5e40f5ea48d1f6a227fdbf3fdceaace84cf.tar.gz binutils-86e3a5e40f5ea48d1f6a227fdbf3fdceaace84cf.tar.bz2 |
* c-typeprint.c (c_type_print_base): Avoid dereferencing NULL
names for TYPE_CODE_STRUCT and TYPE_CODE_UNION types.
TYPE_CODE_ENUM was already testing for this.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/c-typeprint.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f517e43..8147c44 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Sat May 29 15:59:29 1993 Fred Fish (fnf@cygnus.com) + + * c-typeprint.c (c_type_print_base): Avoid dereferencing NULL + names for TYPE_CODE_STRUCT and TYPE_CODE_UNION types. + TYPE_CODE_ENUM was already testing for this. + Fri May 28 17:18:05 1993 Stu Grossman (grossman@cygnus.com) * Makefile.in: Add new file ser-tcp.c. diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 7591317..bf87511 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -514,7 +514,7 @@ c_type_print_base (type, stream, show, level) possible that we should have a better way of distinguising tag names from typedef'd names. (e.g. a new tagname field in the struct type). */ - if (strncmp (name, "struct ", 7) == 0) + if (name != NULL && strncmp (name, "struct ", 7) == 0) { fputs_filtered (name + 7, stream); fputs_filtered (" ", stream); @@ -544,7 +544,7 @@ c_type_print_base (type, stream, show, level) possible that we should have a better way of distinguising tag names from typedef'd names. (e.g. a new tagname field in the struct type). */ - if (strncmp (name, "union ", 6) == 0) + if (name != NULL && strncmp (name, "union ", 6) == 0) { fputs_filtered (name + 6, stream); fputs_filtered (" ", stream); |