aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/types.c b/types.c
index 5fb591ca..cc35d792 100644
--- a/types.c
+++ b/types.c
@@ -51,8 +51,10 @@ CORD type_to_cord(type_t *t) {
c = CORD_cat(c, type_to_cord(arg->type));
if (arg->next) c = CORD_cat(c, ", ");
}
- c = CORD_cat(c, ")->");
- c = CORD_cat(c, type_to_cord(fn->ret));
+ if (fn->ret && fn->ret->tag != VoidType)
+ c = CORD_all(c, ")->", type_to_cord(fn->ret));
+ else
+ c = CORD_all(c, ")");
return c;
}
case StructType: {