Fossil SCM

Fix an off-by-one error in the text line-break algorithm of comformat.c.

drh 2024-01-09 17:04 trunk
Commit eb2100db425fc15b80f50103db43bed75c8a9eda8faef1aee12fc74353fca16a
1 file changed +1 -1
+1 -1
--- src/comformat.c
+++ src/comformat.c
@@ -274,11 +274,11 @@
274274
break;
275275
}
276276
}else if( wordBreak && fossil_isspace(c) ){
277277
int distUTF8;
278278
int nextIndex = comment_next_space(zLine, index, &distUTF8);
279
- if( nextIndex<=0 || distUTF8>maxChars ){
279
+ if( nextIndex<=0 || distUTF8>=maxChars ){
280280
break;
281281
}
282282
charCnt++;
283283
}else{
284284
charCnt++;
285285
--- src/comformat.c
+++ src/comformat.c
@@ -274,11 +274,11 @@
274 break;
275 }
276 }else if( wordBreak && fossil_isspace(c) ){
277 int distUTF8;
278 int nextIndex = comment_next_space(zLine, index, &distUTF8);
279 if( nextIndex<=0 || distUTF8>maxChars ){
280 break;
281 }
282 charCnt++;
283 }else{
284 charCnt++;
285
--- src/comformat.c
+++ src/comformat.c
@@ -274,11 +274,11 @@
274 break;
275 }
276 }else if( wordBreak && fossil_isspace(c) ){
277 int distUTF8;
278 int nextIndex = comment_next_space(zLine, index, &distUTF8);
279 if( nextIndex<=0 || distUTF8>=maxChars ){
280 break;
281 }
282 charCnt++;
283 }else{
284 charCnt++;
285

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button