All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

* Re: [PATCH] expression.c: Adding va_end().
  2007-07-19  0:02 [PATCH] expression.c: Adding va_end() ricknu-0
@ 2007-07-25  4:48 ` Josh Triplett
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Triplett @ 2007-07-25  4:48 UTC (permalink / raw)
  To: ricknu-0; +Cc: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

ricknu-0@student.ltu.se wrote:
> Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
> ---
> According to the manual, it needs a va_end() in the same function.

It does indeed; good catch.  Applied.

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.