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

This commit is contained in:
Craig Barnes 2021-01-14 21:30:06 +00:00 committed by Daniel Eklöf
parent acb3f1cd10
commit d2c00d73ec
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
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;