cedric pushed a commit to branch efl-1.11.

http://git.enlightenment.org/core/efl.git/commit/?id=b6019a7daeb1b52bc6aa823da2eefda7513400a8

commit b6019a7daeb1b52bc6aa823da2eefda7513400a8
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Mon Sep 19 14:02:43 2016 -0700

    eina: populate memory in the right limit.
---
 src/lib/eina/eina_file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index 08e3a2d..ef3e9d2 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;
 }

-- 


Reply via email to