summaryrefslogtreecommitdiff
path: root/src
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 14:02:43 -0700
commit25aef34aa044503024b6b608feb87d4d4e02ff3b (patch)
tree3125d37f035e24e20c208f3671d40f6dbb8db448 /src
parente4958e9faa7bbf5992aea9d908374350f88f7efe (diff)
eina: populate memory in the right limit.
Diffstat (limited to 'src')
-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 b1f9328c1b..994905f52a 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -316,12 +316,14 @@ _eina_file_map_populate(char *map, unsigned int size, Eina_Bool hugetlb)
316 unsigned int i; 316 unsigned int i;
317 unsigned int s; 317 unsigned int s;
318 318
319 if (size == 0) return 0;
320
319 s = hugetlb ? EINA_HUGE_PAGE : EINA_SMALL_PAGE; 321 s = hugetlb ? EINA_HUGE_PAGE : EINA_SMALL_PAGE;
320 322
321 for (i = 0; i < size; i += s) 323 for (i = 0; i < size; i += s)
322 r ^= map[i]; 324 r ^= map[i];
323 325
324 r ^= map[size]; 326 r ^= map[size - 1];
325 327
326 return r; 328 return r;
327} 329}