efi: add assert to silence coverity

CID#1502668
This commit is contained in:
Luca Boccassi
2023-07-16 00:39:13 +01:00
parent fa5d277512
commit 8ecd67e18e

View File

@@ -544,9 +544,11 @@ static bool push_str(FormatContext *ctx, SpecifierContext *sp) {
if (sp->wstr && sizeof(wchar_t) == sizeof(char16_t)) {
memcpy(ctx->buf + ctx->n, sp->wstr, sp->len * sizeof(*sp->wstr));
ctx->n += sp->len;
} else
} else {
assert(sp->str || sp->wstr);
for (size_t i = 0; i < sp->len; i++)
ctx->buf[ctx->n++] = sp->str ? sp->str[i] : sp->wstr[i];
}
if (sp->align_left)
push_padding(ctx, ' ', sp->padded_len);