[LIB]: Handle void in typedef__fprintf

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-05-26 14:50:51 -03:00
parent 90d6202e3c
commit fdcd10fa3f
1 changed files with 9 additions and 1 deletions

View File

@ -448,12 +448,20 @@ size_t typedef__fprintf(const struct tag *tag_self, const struct cu *cu,
FILE *fp)
{
struct type *self = tag__type(tag_self);
const struct tag *type = cu__find_tag_by_id(cu, tag_self->type);
const struct tag *type;
const struct tag *ptr_type;
char bf[512];
int is_pointer = 0;
size_t printed;
/*
* Check for void (humm, perhaps we should have a fake void tag instance
* to avoid all these checks?
*/
if (tag_self->type == 0)
return fprintf(fp, "typedef void %s", type__name(self, cu));
type = cu__find_tag_by_id(cu, tag_self->type);
if (type == NULL) {
tag__type_not_found(tag_self);
return 0;