Skip to content
Snippets Groups Projects
Commit c773ed7f authored by deuce's avatar deuce
Browse files

Fix off-by-one error checking if the first word of the next line would have

fit on the current line.
parent 1e6b866f
No related branches found
No related tags found
No related merge requests found
......@@ -363,7 +363,7 @@ char* wordwrap(char* inbuf, int len, int oldlen, BOOL handle_quotes)
if(icol < oldlen) { /* If this line is overly long, It's impossible for the next word to fit */
/* k will equal the length of the first word on the next line */
k = get_word_len(inbuf, i+1);
if(icol+k+1 < oldlen) { /* The next word would have fit but isn't here. Must be a hard CR */
if(icol+k < oldlen) { /* The next word would have fit but isn't here. Must be a hard CR */
linebuf[l++]='\r';
linebuf[l++]='\n';
outbuf_append(&outbuf, &outp, linebuf, l, &outbuf_size);
......
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