Skip to content
Snippets Groups Projects
Commit 9eba17da 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 cd64a0bd
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment