From 3bbb218e2682de2d566cc66115a108a56c04f42c Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Fri, 19 Jul 2013 08:53:53 +0200 Subject: Fix error handling macro E Previously the macro argument err was expanded and thus potentially evaluated multiple times. This is fine for simple values or pure functions, but not for say iohelp_create_iouser. Fix this by evaluating the macro argument only once. --- libiohelp/iouser-create.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libiohelp/iouser-create.c b/libiohelp/iouser-create.c index f1dd2f0e..980c8a1e 100644 --- a/libiohelp/iouser-create.c +++ b/libiohelp/iouser-create.c @@ -33,8 +33,9 @@ iohelp_create_iouser (struct iouser **user, struct idvec *uids, return 0; } -#define E(err) \ +#define E(err_) \ do { \ + error_t err = err_; \ if (err) \ { \ *user = 0; \ -- cgit v1.2.3