Fossil SCM
Fix an off-by-one error in the text line-break algorithm of comformat.c.
Commit
eb2100db425fc15b80f50103db43bed75c8a9eda8faef1aee12fc74353fca16a
Parent
2ddf62a32036acc…
1 file changed
+1
-1
+1
-1
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -274,11 +274,11 @@ | ||
| 274 | 274 | break; |
| 275 | 275 | } |
| 276 | 276 | }else if( wordBreak && fossil_isspace(c) ){ |
| 277 | 277 | int distUTF8; |
| 278 | 278 | int nextIndex = comment_next_space(zLine, index, &distUTF8); |
| 279 | - if( nextIndex<=0 || distUTF8>maxChars ){ | |
| 279 | + if( nextIndex<=0 || distUTF8>=maxChars ){ | |
| 280 | 280 | break; |
| 281 | 281 | } |
| 282 | 282 | charCnt++; |
| 283 | 283 | }else{ |
| 284 | 284 | charCnt++; |
| 285 | 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 |
| --- 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 |