Fossil SCM
Looping over too many triples also seems theoretically possible in contextDiff().
Commit
8ba47b1cc96062b76dc9970c3390b2ef2f89dcd9dff48d537bedb7b2923e0167
Parent
3c9472e56b7d8e0…
1 file changed
+1
-1
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -422,11 +422,11 @@ | ||
| 422 | 422 | R = p->aEdit; |
| 423 | 423 | mxr = p->nEdit; |
| 424 | 424 | while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; } |
| 425 | 425 | for(r=0; r<mxr; r += 3*nr){ |
| 426 | 426 | /* Figure out how many triples to show in a single block */ |
| 427 | - for(nr=1; R[r+nr*3]>0 && R[r+nr*3]<nContext*2; nr++){} | |
| 427 | + for(nr=1; 3*nr<mxr && R[r+nr*3]>0 && R[r+nr*3]<(int)nContext*2; nr++){} | |
| 428 | 428 | /* printf("r=%d nr=%d\n", r, nr); */ |
| 429 | 429 | |
| 430 | 430 | /* For the current block comprising nr triples, figure out |
| 431 | 431 | ** how many lines of A and B are to be displayed |
| 432 | 432 | */ |
| 433 | 433 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -422,11 +422,11 @@ | |
| 422 | R = p->aEdit; |
| 423 | mxr = p->nEdit; |
| 424 | while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; } |
| 425 | for(r=0; r<mxr; r += 3*nr){ |
| 426 | /* Figure out how many triples to show in a single block */ |
| 427 | for(nr=1; R[r+nr*3]>0 && R[r+nr*3]<nContext*2; nr++){} |
| 428 | /* printf("r=%d nr=%d\n", r, nr); */ |
| 429 | |
| 430 | /* For the current block comprising nr triples, figure out |
| 431 | ** how many lines of A and B are to be displayed |
| 432 | */ |
| 433 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -422,11 +422,11 @@ | |
| 422 | R = p->aEdit; |
| 423 | mxr = p->nEdit; |
| 424 | while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; } |
| 425 | for(r=0; r<mxr; r += 3*nr){ |
| 426 | /* Figure out how many triples to show in a single block */ |
| 427 | for(nr=1; 3*nr<mxr && R[r+nr*3]>0 && R[r+nr*3]<(int)nContext*2; nr++){} |
| 428 | /* printf("r=%d nr=%d\n", r, nr); */ |
| 429 | |
| 430 | /* For the current block comprising nr triples, figure out |
| 431 | ** how many lines of A and B are to be displayed |
| 432 | */ |
| 433 |