BUG/MINOR: applet: Fix applet_getword() to not return one extra byte

applet_getword() function is returning one extra byte when a string is
returned because the "ret" variable is not reset before the loop on the
data. The patch also fixes applet_getline().

It is a 3.3-specific issue. No need to backport.
This commit is contained in:
Christopher Faulet 2025-07-22 18:23:57 +02:00
parent 32f864e645
commit bbf668a18a

View File

@ -645,7 +645,7 @@ static inline int applet_getword(const struct appctx *appctx, char *str, int len
}
p = b_head(buf);
ret = 0;
while (max) {
*str++ = *p;
ret++;