From 32135c9f1e9defd884b7cc1157722678ba4994d2 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 16 Sep 2026 16:50:17 +0300 Subject: silence overflow warning --- include/conts/sp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/conts/sp.h b/include/conts/sp.h index 2f88293..f760fd3 100644 --- a/include/conts/sp.h +++ b/include/conts/sp.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "conts.h" @@ -97,6 +98,8 @@ static inline void SP(trunc)(struct SP_STRUCT *s) static inline int SP(append_strn)(struct SP_STRUCT *s, const char *buf, size_t n) { + /* check for overflows, silences a gcc warning at least */ + assert(s->l < SIZE_MAX - n); size_t nl = s->l + n; /* we can fit into the static buffer */ -- cgit v1.3