From ad541c67761b8aa6da1566802c347cac4018d0c2 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 2 Nov 2026 20:50:24 +0100 Subject: Move the build sources into src/ --- ot_fmt.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 ot_fmt.c (limited to 'ot_fmt.c') diff --git a/ot_fmt.c b/ot_fmt.c deleted file mode 100644 index 362c9b5..0000000 --- a/ot_fmt.c +++ /dev/null @@ -1,40 +0,0 @@ -/* This software was written by Dirk Engling - It is considered beerware. Prost. Skol. Cheers or whatever. */ - -/* System */ -#include -#include -#include - -/* Opentracker */ -#include "ot_fmt.h" - -void fmt_append(char **cursor, const char *end, const char *format, ...) { - va_list arguments; - size_t room; - int written; - - if (*cursor >= end) { - *cursor = (char *)end; - return; - } - - room = (size_t)(end - *cursor); - va_start(arguments, format); - written = vsnprintf(*cursor, room, format, arguments); - va_end(arguments); - - if (written < 0) - return; - *cursor = (size_t)written >= room ? (char *)end : *cursor + written; -} - -void fmt_bytes(char **cursor, const char *end, const void *bytes, size_t length) { - if (*cursor >= end || (size_t)(end - *cursor) < length) { - *cursor = (char *)end; - return; - } - - memcpy(*cursor, bytes, length); - *cursor += length; -} -- cgit v1.3