aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-12-27 13:54:42 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-12-29 01:16:25 +0000
commit8bff95f3ce0396ff40b4f7d943ea856ac3f846c3 (patch)
tree38cf854c96d89ae7ccbf1ca1fd0fd3d972c8d057
parent37ddbbe5535cb6c27b8a026b2f28d64319b9f802 (diff)
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
-rw-r--r--lib/libc/gen/uexterr_format.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c
index e8ddfbd578e3..68cd2abfe312 100644
--- a/lib/libc/gen/uexterr_format.c
+++ b/lib/libc/gen/uexterr_format.c
@@ -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);
}