From: Christoph Mallon Date: Tue, 2 Dec 2008 14:02:43 +0000 (+0000) Subject: Do not print a space in a return statement, which has no expression. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=07611ee0ac745341d7d8ea4874b1cba13df0abab;p=cparser Do not print a space in a return statement, which has no expression. [r24219] --- diff --git a/ast.c b/ast.c index 036c7c7..7d84d0b 100644 --- a/ast.c +++ b/ast.c @@ -879,10 +879,14 @@ static void print_compound_statement(const compound_statement_t *block) */ static void print_return_statement(const return_statement_t *statement) { - fputs("return ", out); - if (statement->value != NULL) - print_expression(statement->value); - fputs(";\n", out); + expression_t const *const val = statement->value; + if (val != NULL) { + fputs("return ", out); + print_expression(val); + fputs(";\n", out); + } else { + fputs("return;\n", out); + } } /**