From c3eee8e333866d92e5fd94ae83cef618758c11bb Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 15 Sep 2025 18:50:32 +0200 Subject: FICS RPBLC v1.4.6 --- FICS/maxxes-utils.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 FICS/maxxes-utils.h (limited to 'FICS/maxxes-utils.h') diff --git a/FICS/maxxes-utils.h b/FICS/maxxes-utils.h new file mode 100644 index 0000000..667151f --- /dev/null +++ b/FICS/maxxes-utils.h @@ -0,0 +1,22 @@ +#ifndef MAXXES_UTILITIES_H +#define MAXXES_UTILITIES_H + +#include + +#include "common.h" + +#define msnprintf(p_str, p_size, ...) \ + snprintf_trunc_chk(__FILE__, __LINE__, (p_str), (p_size), __VA_ARGS__) +#define mstrlcpy(p_dst, p_src, p_dstsize) \ + strlcpy_trunc_chk((p_dst), (p_src), (p_dstsize), __FILE__, __LINE__) +#define mstrlcat(p_dst, p_src, p_dstsize) \ + strlcat_trunc_chk((p_dst), (p_src), (p_dstsize), __FILE__, __LINE__) + +void snprintf_trunc_chk(const char *file, const long int line, + char *str, size_t size, const char *format, ...) PRINTFLIKE(5); +void strlcpy_trunc_chk(char *dst, const char *src, size_t dstsize, + const char *, const long int); +void strlcat_trunc_chk(char *dst, const char *src, size_t dstsize, + const char *, const long int); + +#endif -- cgit v1.2.3