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
parent
302fca9f4c
commit
5ef2f7c2fa
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);
|
vfprintf(stderr, fmt, ap);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FAIL(c, ...) \
|
#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);
|
va_start(ap, str);
|
||||||
fprintf(stderr, "FATAL ERROR: ");
|
fprintf(stderr, "FATAL ERROR: ");
|
||||||
vfprintf(stderr, str, ap);
|
vfprintf(stderr, str, ap);
|
||||||
|
va_end(ap);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue