mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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>
This commit is contained in:
parent
302fca9f4c
commit
5ef2f7c2fa
2 changed files with 2 additions and 0 deletions
1
checks.c
1
checks.c
|
@ -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
1
util.h
|
@ -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…
Add table
Add a link
Reference in a new issue