projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08631b9
)
Do not print a space in a return statement, which has no expression.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 2 Dec 2008 14:02:43 +0000
(14:02 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 2 Dec 2008 14:02:43 +0000
(14:02 +0000)
[r24219]
ast.c
patch
|
blob
|
history
diff --git
a/ast.c
b/ast.c
index
036c7c7
..
7d84d0b
100644
(file)
--- 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);
+ }
}
/**