fix line crlf stripping but util.c

Signed-off-by: AGentooCat <agentoocat@mail.i2p>
This commit is contained in:
2025-06-09 09:33:04 +00:00
parent 400cc80f04
commit 9b5f653c98

View File

@ -30,7 +30,7 @@ void strip_crlf(const char *text) {
char *cur = strchr(text, 0);
// sanely assuming that text has a NUL char
cur -= 1;
while (*cur == '\r' || *cur == '\n') {
while (cur >= text && (*cur == '\r' || *cur == '\n')) {
*cur = 0;
cur -= 1;
}