linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ricknu-0@student.ltu.se
To: linux-sparse@vger.kernel.org
Subject: [PATCH] expression.c: Adding va_end().
Date: Thu, 19 Jul 2007 02:02:55 +0200	[thread overview]
Message-ID: <1184803375.469eaa2f8bff0@portal.student.luth.se> (raw)

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 **);

             reply	other threads:[~2007-07-19  0:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19  0:02 ricknu-0 [this message]
2007-07-25  4:48 ` [PATCH] expression.c: Adding va_end() Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1184803375.469eaa2f8bff0@portal.student.luth.se \
    --to=ricknu-0@student.ltu.se \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).