Fossil SCM

Fix an off-by-one error in the delta generator.

drh 2010-12-20 17:29 trunk
Commit d7dfb5ae42ec7ac14df46856e7fba93fefaa5306
1 file changed +1 -1
+1 -1
--- src/delta.c
+++ src/delta.c
@@ -438,11 +438,11 @@
438438
bestCnt = 0;
439439
break;
440440
}
441441
442442
/* 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 ){
444444
/* We have reached the end of the file and have not found any
445445
** matches. Do an "insert" for everything that does not match */
446446
putInt(lenOut-base, &zDelta);
447447
*(zDelta++) = ':';
448448
memcpy(zDelta, &zOut[base], lenOut-base);
449449
--- 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

Keyboard Shortcuts

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