git: 8bff95f3ce03 - main - exterror: add support for the format specifiers in the extended error msg
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 29 Dec 2025 01:16:33 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=8bff95f3ce0396ff40b4f7d943ea856ac3f846c3
commit 8bff95f3ce0396ff40b4f7d943ea856ac3f846c3
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-12-27 13:54:42 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-12-29 01:16:25 +0000
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
---
lib/libc/gen/uexterr_format.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
}