Browse Source

dtc: Use va_end to match corresponding va_start

Although on some systems va_end is a no-op, it is good practice
to use va_end, especially since the manual states:

"Each invocation of va_start() must be matched by a corresponding
invocation of va_end() in the same function."

Signed-off-by: Colin Ian King <colin.king@canonical.com>
main
Colin Ian King 10 years ago committed by David Gibson
parent
commit
5ef2f7c2fa
  1. 1
      checks.c
  2. 1
      util.h

1
checks.c

@ -113,6 +113,7 @@ static inline void check_msg(struct check *c, const char *fmt, ...) @@ -113,6 +113,7 @@ static inline void check_msg(struct check *c, const char *fmt, ...)
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
}
va_end(ap);
}

#define FAIL(c, ...) \

1
util.h

@ -34,6 +34,7 @@ static inline void __attribute__((noreturn)) die(const char *str, ...) @@ -34,6 +34,7 @@ static inline void __attribute__((noreturn)) die(const char *str, ...)
va_start(ap, str);
fprintf(stderr, "FATAL ERROR: ");
vfprintf(stderr, str, ap);
va_end(ap);
exit(1);
}


Loading…
Cancel
Save