Fossil SCM
Fix an off-by-one error in the delta generator.
Commit
d7dfb5ae42ec7ac14df46856e7fba93fefaa5306
Parent
cb745cc7898674f…
1 file changed
+1
-1
+1
-1
| --- src/delta.c | ||
| +++ src/delta.c | ||
| @@ -438,11 +438,11 @@ | ||
| 438 | 438 | bestCnt = 0; |
| 439 | 439 | break; |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /* If we reach this point, it means no match is found so far */ |
| 443 | - if( base+i+NHASH>lenOut ){ | |
| 443 | + if( base+i+NHASH>=lenOut ){ | |
| 444 | 444 | /* We have reached the end of the file and have not found any |
| 445 | 445 | ** matches. Do an "insert" for everything that does not match */ |
| 446 | 446 | putInt(lenOut-base, &zDelta); |
| 447 | 447 | *(zDelta++) = ':'; |
| 448 | 448 | memcpy(zDelta, &zOut[base], lenOut-base); |
| 449 | 449 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -438,11 +438,11 @@ | |
| 438 | bestCnt = 0; |
| 439 | break; |
| 440 | } |
| 441 | |
| 442 | /* If we reach this point, it means no match is found so far */ |
| 443 | if( base+i+NHASH>lenOut ){ |
| 444 | /* We have reached the end of the file and have not found any |
| 445 | ** matches. Do an "insert" for everything that does not match */ |
| 446 | putInt(lenOut-base, &zDelta); |
| 447 | *(zDelta++) = ':'; |
| 448 | memcpy(zDelta, &zOut[base], lenOut-base); |
| 449 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -438,11 +438,11 @@ | |
| 438 | bestCnt = 0; |
| 439 | break; |
| 440 | } |
| 441 | |
| 442 | /* If we reach this point, it means no match is found so far */ |
| 443 | if( base+i+NHASH>=lenOut ){ |
| 444 | /* We have reached the end of the file and have not found any |
| 445 | ** matches. Do an "insert" for everything that does not match */ |
| 446 | putInt(lenOut-base, &zDelta); |
| 447 | *(zDelta++) = ':'; |
| 448 | memcpy(zDelta, &zOut[base], lenOut-base); |
| 449 |