aboutsummaryrefslogtreecommitdiff
path: root/src/or/consdiff.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2017-04-17 10:07:31 +0200
committerSebastian Hahn <sebastian@torproject.org>2017-04-17 10:10:46 +0200
commit5a7e39c0cbca3f2b94834167154472a61fc34a03 (patch)
tree53be033d4c00aa3d04d0e9b02aa82a38eb61f7bd /src/or/consdiff.c
parentb081a7ed21ae729f6e195715e130edaca3e0b7fe (diff)
downloadtor-5a7e39c0cbca3f2b94834167154472a61fc34a03.tar.gz
tor-5a7e39c0cbca3f2b94834167154472a61fc34a03.zip
Fix diff generation with line added at start
The consdiff generation logic would skip over lines added at the start of the second file, and generate a diff that it would the immediately refuse because it couldn't be used to reproduce the second file from the first. Fixes #21996.
Diffstat (limited to 'src/or/consdiff.c')
-rw-r--r--src/or/consdiff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/consdiff.c b/src/or/consdiff.c
index d2a2af1b5f..cd22fd44a1 100644
--- a/src/or/consdiff.c
+++ b/src/or/consdiff.c
@@ -671,7 +671,7 @@ gen_ed_diff(const smartlist_t *cons1, const smartlist_t *cons2,
*/
i1=len1-1, i2=len2-1;
char buf[128];
- while (i1 > 0 || i2 > 0) {
+ while (i1 >= 0 || i2 >= 0) {
int start1x, start2x, end1, end2, added, deleted;