summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-13 17:35:44 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-13 17:35:44 +0100
commit85e1885525977809ff6a3b70abb84d3a63e41817 (patch)
treee985e74ed4d613126b24839d710e4b49db753824 /methods
parent14ea309a018d1604db45e29baeeb155cf6401c60 (diff)
parent86fc2ca8909eb686e2ad751acb0f0eaf706d9d5e (diff)
merged from lp:~donkult/apt/experimental/
Diffstat (limited to 'methods')
-rw-r--r--methods/rred.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index bf9294d96..e37a12ed9 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -235,7 +235,9 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/
MMap ed_cmds(Patch, MMap::ReadOnly);
MMap in_file(From, MMap::ReadOnly);
- if (ed_cmds.Size() == 0 || in_file.Size() == 0)
+ unsigned long long const ed_size = ed_cmds.Size();
+ unsigned long long const in_size = in_file.Size();
+ if (ed_size == 0 || in_size == 0)
return MMAP_FAILED;
EdCommand* commands = 0;
@@ -244,10 +246,10 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/
const char* begin = (char*) ed_cmds.Data();
const char* end = begin;
- const char* ed_end = (char*) ed_cmds.Data() + ed_cmds.Size();
+ const char* ed_end = (char*) ed_cmds.Data() + ed_size;
const char* input = (char*) in_file.Data();
- const char* input_end = (char*) in_file.Data() + in_file.Size();
+ const char* input_end = (char*) in_file.Data() + in_size;
size_t i;