From 43ab3781a768f8071c6e061fd451973e623bb326 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 8 Mar 2026 01:11:47 +0100 Subject: Added is_too_long() --- FICS/maxxes-utils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'FICS/maxxes-utils.c') diff --git a/FICS/maxxes-utils.c b/FICS/maxxes-utils.c index 7db8369..987be47 100644 --- a/FICS/maxxes-utils.c +++ b/FICS/maxxes-utils.c @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 Markus Uhlin +// SPDX-FileCopyrightText: 2024-2026 Markus Uhlin // SPDX-License-Identifier: ISC #include @@ -12,6 +12,12 @@ #include "maxxes-utils.h" +bool +is_too_long(const int p_ret, const size_t p_maxlen) +{ + return (p_ret < 0 || (size_t)p_ret >= p_maxlen); +} + void snprintf_trunc_chk(const char *file, const long int line, char *str, size_t size, const char *format, ...) -- cgit v1.2.3