Skip to content

Commit

Permalink
dtc: Use va_end to match corresponding va_start
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and dgibson committed Jan 13, 2015
1 parent 302fca9 commit 5ef2f7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...) \
Expand Down
1 change: 1 addition & 0 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5ef2f7c

Please sign in to comment.