mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
system/fastboot: Add format string support for fastboot_fail()
Add support for producing output according to a format like printf(). Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
2eb18712d3
commit
89c784188e
1 changed files with 7 additions and 1 deletions
|
|
@ -260,9 +260,15 @@ static void fastboot_ack(FAR struct fastboot_ctx_s *context,
|
|||
}
|
||||
|
||||
static void fastboot_fail(FAR struct fastboot_ctx_s *context,
|
||||
FAR const char *reason)
|
||||
FAR const char *fmt, ...)
|
||||
{
|
||||
char reason[FASTBOOT_MSG_LEN];
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(reason, sizeof(reason), fmt, ap);
|
||||
fastboot_ack(context, "FAIL", reason);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static void fastboot_okay(FAR struct fastboot_ctx_s *context,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue