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:24:32 -0700
commit00e085633ec564f26efd5044e81dff01f94433db (patch)
treedb28ac826a908ed17446059d5d1cb889eae5e2c7
parente717a89cd38654e331194b96163c7fea2aab29f2 (diff)
downloadefl-00e085633ec564f26efd5044e81dff01f94433db.tar.gz
eina: populate memory in the right limit.
-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 08e3a2dc39..ef3e9d24c5 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -333,12 +333,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;
}