diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-15 01:59:17 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-15 14:59:02 -0600 |
commit | e38a2d29292ad3fad64729ef958ff07e3bca02cf (patch) | |
tree | 6b647d225665cd4fb2733a57bdfa5f0e96692995 /cmd/sbc_harness/fs_harness_uptime_txt.c | |
parent | 3faaad9fe1f11cfe5699c6720c897bfddc7cf49a (diff) |
Fully banish printf from the firmware
Diffstat (limited to 'cmd/sbc_harness/fs_harness_uptime_txt.c')
-rw-r--r-- | cmd/sbc_harness/fs_harness_uptime_txt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/sbc_harness/fs_harness_uptime_txt.c b/cmd/sbc_harness/fs_harness_uptime_txt.c index f7b755f..97246ea 100644 --- a/cmd/sbc_harness/fs_harness_uptime_txt.c +++ b/cmd/sbc_harness/fs_harness_uptime_txt.c @@ -4,11 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <stdio.h> /* for snprintf() */ - #include <libhw/generic/alarmclock.h> #include <util9p/static.h> #include <libmisc/alloc.h> /* for heap_alloc(), free() */ +#include <libmisc/fmt.h> /* for fmt_snprint() */ #include "fs_harness_uptime_txt.h" @@ -120,7 +119,7 @@ static void uptime_fio_pread(struct uptime_fio *self, struct lib9p_srv_ctx *ctx, if (byte_offset == 0 || self->buf_len == 0) { uint64_t now = LO_CALL(bootclock, get_time_ns); - self->buf_len = snprintf(self->buf, sizeof(self->buf), "%"PRIu64"ns\n", now); + self->buf_len = fmt_snprint(self->buf, sizeof(self->buf), now, "ns\n"); } if (byte_offset > (uint64_t)self->buf_len) { |