diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-03-14 18:10:31 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-02 20:44:53 -0600 |
commit | ece605ec021de84aa1a9e282f342c38505ba794b (patch) | |
tree | fc70d13d59f454d58d5b129eb2a8abaf57a7c9e5 /lib9p/9p.c | |
parent | 4342605da113113e9f4c80f1237a6e7b4459e180 (diff) |
lib9p: Use fmt_vsnprintf instead of plain vsnprintf
Diffstat (limited to 'lib9p/9p.c')
-rw-r--r-- | lib9p/9p.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -6,9 +6,10 @@ #include <inttypes.h> /* for PRIu{n} */ #include <stdarg.h> /* for va_* */ -#include <stdio.h> /* for vsnprintf() */ #include <string.h> /* for strncpy() */ +#include <pico/fmt_printf.h> /* for fmt_vsnprintf() */ + #include <lib9p/9p.h> /* strings ********************************************************************/ @@ -79,7 +80,7 @@ int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *f if (lib9p_ctx_has_error(ctx)) return -1; va_start(args, fmt); - n = vsnprintf(ctx->err_msg, sizeof(ctx->err_msg), fmt, args); + n = fmt_vsnprintf(ctx->err_msg, sizeof(ctx->err_msg), fmt, args); va_end(args); if ((size_t)(n+1) < sizeof(ctx->err_msg)) memset(&ctx->err_msg[n+1], 0, sizeof(ctx->err_msg)-(n+1)); |