Skip to content
Snippets Groups Projects
Commit 68b2fa75 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Sanity-check the oldlen argument value to wordwrap()

If the oldlen param value is less than one, set to a sane non-zero value (79).
Fix issue #576
parent 36dddeff
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4519 passed
......@@ -571,6 +571,8 @@ char* wordwrap(char* inbuf, int len, int oldlen, BOOL handle_quotes, BOOL is_utf
struct paragraph *paragraphs;
BOOL has_crs;
if (oldlen < 1)
oldlen = 79;
paragraphs = word_unwrap(inbuf, oldlen, handle_quotes, &has_crs, is_utf8);
if (paragraphs == NULL)
return NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment