From c773ed7f38c6849f159b97c661c8b3f531b7ea59 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 7 May 2015 11:02:06 +0000
Subject: [PATCH] Fix off-by-one error checking if the first word of the next
 line would have fit on the current line.

---
 src/sbbs3/wordwrap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/wordwrap.c b/src/sbbs3/wordwrap.c
index 3c64df1aa2..01143ead2f 100644
--- a/src/sbbs3/wordwrap.c
+++ b/src/sbbs3/wordwrap.c
@@ -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);
-- 
GitLab