diff options
author | Tom Rini <trini@konsulko.com> | 2015-04-23 13:53:09 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-04-23 14:56:10 -0400 |
commit | 5f757cdcc6efbefec09b8f964a234f84ff9fa7f6 (patch) | |
tree | e8058651bd0319757d33fb7a949b9491211de7c7 /lib/vsprintf.c | |
parent | bba97cd2c96ae0c21ad916a9c4eb363fe569a2f9 (diff) | |
parent | f3d46bd658ef4df575ec26c29e472ac858723159 (diff) | |
download | u-boot-imx-5f757cdcc6efbefec09b8f964a234f84ff9fa7f6.zip u-boot-imx-5f757cdcc6efbefec09b8f964a234f84ff9fa7f6.tar.gz u-boot-imx-5f757cdcc6efbefec09b8f964a234f84ff9fa7f6.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-dm
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e0f2648..bedc865 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -842,13 +842,11 @@ int sprintf(char *buf, const char *fmt, ...) return i; } -void panic(const char *fmt, ...) +static void panic_finish(void) __attribute__ ((noreturn)); + +static void panic_finish(void) { - va_list args; - va_start(args, fmt); - vprintf(fmt, args); putc('\n'); - va_end(args); #if defined(CONFIG_PANIC_HANG) hang(); #else @@ -859,6 +857,21 @@ void panic(const char *fmt, ...) ; } +void panic_str(const char *str) +{ + puts(str); + panic_finish(); +} + +void panic(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vprintf(fmt, args); + va_end(args); + panic_finish(); +} + void __assert_fail(const char *assertion, const char *file, unsigned line, const char *function) { |