* [PATCH] expression.c: Adding va_end().
@ 2007-07-19 0:02 ricknu-0
2007-07-25 4:48 ` Josh Triplett
0 siblings, 1 reply; 2+ messages in thread
From: ricknu-0 @ 2007-07-19 0:02 UTC (permalink / raw)
To: linux-sparse
Adding va_end().
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
---
According to the manual, it needs a va_end() in the same function.
diff --git a/expression.c b/expression.c
index 77d665d..857ec08 100644
--- a/expression.c
+++ b/expression.c
@@ -30,15 +30,15 @@
static int match_oplist(int op, ...)
{
va_list args;
+ int nextop;
va_start(args, op);
- for (;;) {
- int nextop = va_arg(args, int);
- if (!nextop)
- return 0;
- if (op == nextop)
- return 1;
- }
+ do {
+ nextop = va_arg(args, int);
+ } while (nextop != 0 && nextop != op);
+ va_end(args);
+
+ return nextop != 0;
}
static struct token *comma_expression(struct token *, struct expression **);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-25 4:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 0:02 [PATCH] expression.c: Adding va_end() ricknu-0
2007-07-25 4:48 ` Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).