summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-09-19 14:02:43 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-09-19 15:25:59 -0700
commite159b2cec65cbf8f957f64e149018b20e412a50b (patch)
tree5bcbe8802e6e1b31e048622279a4382371b0393f
parentdf7dbfa5419053a8c1b62ef65e0c3c3cee3bbaa4 (diff)
downloadefl-e159b2cec65cbf8f957f64e149018b20e412a50b.tar.gz
eina: populate memory in the right limit.efl-1.10
-rw-r--r--src/lib/eina/eina_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index d86313bcbf..1679f8aabc 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -332,12 +332,14 @@ _eina_file_map_populate(char *map, unsigned int size, Eina_Bool hugetlb)
unsigned int i;
unsigned int s;
+ if (size == 0) return 0;
+
s = hugetlb ? EINA_HUGE_PAGE : EINA_SMALL_PAGE;
for (i = 0; i < size; i += s)
r ^= map[i];
- r ^= map[size];
+ r ^= map[size - 1];
return r;
}