Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1738)

Unified Diff: src/cmd/sam/file.c

Issue 165071: sam: fix off-by-one in buffer merge. (Closed)
Patch Set: code review 165071: sam: fix off-by-one in buffer merge. Created 15 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/sam/file.c
===================================================================
--- a/src/cmd/sam/file.c
+++ b/src/cmd/sam/file.c
@@ -139,7 +139,7 @@
if(merge.f != f
|| p0-(merge.p0+merge.n)>Maxmerge /* too far */
- || merge.nbuf+((p0+ns)-(merge.p0+merge.n))>RBUFSIZE) /* too long */
+ || merge.nbuf+((p0+ns)-(merge.p0+merge.n))>=RBUFSIZE) /* too long */
flushmerge();
if(ns>=RBUFSIZE){
@@ -178,7 +178,7 @@
if(merge.f != f
|| p0-(merge.p0+merge.n)>Maxmerge /* too far */
- || merge.nbuf+(p0-(merge.p0+merge.n))>RBUFSIZE){ /* too long */
+ || merge.nbuf+(p0-(merge.p0+merge.n))>=RBUFSIZE){ /* too long */
flushmerge();
merge.f = f;
merge.p0 = p0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b