Add xsnprintf() and remove some unnecessary strlen(3) calls

This commit is contained in:
Craig Barnes 2021-01-14 21:30:06 +00:00
parent b25b8a78a9
commit 3f4cfa338b
8 changed files with 86 additions and 36 deletions

8
xsnprintf.h Normal file
View file

@ -0,0 +1,8 @@
#pragma once
#include <stdarg.h>
#include <stddef.h>
#include "macros.h"
size_t xsnprintf(char *buf, size_t len, const char *fmt, ...) PRINTF(3) NONNULL_ARGS;
size_t xvsnprintf(char *buf, size_t len, const char *fmt, va_list ap) VPRINTF(3) NONNULL_ARGS;