Browse Source

[libc] Fix the addr=NULL issue in mmap.

Bernard Xiong 6 năm trước cách đây
mục cha
commit
97560dd8e2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      components/libc/mmap/posix_mmap.c

+ 1 - 1
components/libc/mmap/posix_mmap.c

@@ -35,7 +35,7 @@ void *mmap(void *addr, size_t length, int prot, int flags,
         cur = lseek(fd, 0, SEEK_SET);
         cur = lseek(fd, 0, SEEK_SET);
 
 
         lseek(fd, offset, SEEK_SET);
         lseek(fd, offset, SEEK_SET);
-        read_bytes = read(fd, addr, length);
+        read_bytes = read(fd, mem, length);
         if (read_bytes != length)
         if (read_bytes != length)
         {
         {
             if (addr == RT_NULL)
             if (addr == RT_NULL)