exterror: add support for the format specifiers in the extended error msg

Note that we trust kernel code to only request the printout of integer
types, and use the 'j' modifier always.

Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
This commit is contained in:
Konstantin Belousov
2025-12-27 15:54:42 +02:00
parent 37ddbbe553
commit 8bff95f3ce
+2 -1
View File
@@ -29,7 +29,8 @@ __uexterr_format(const struct uexterror *ue, char *buf, size_t bufsz)
ue->error, ue->cat, ue->src_line,
(uintmax_t)ue->p1, (uintmax_t)ue->p2);
} else {
strlcpy(buf, ue->msg, bufsz);
snprintf(buf, bufsz, ue->msg, (uintmax_t)ue->p1,
(uintmax_t)ue->p2);
}
return (0);
}