Skip to content

Commit 828fceb

Browse files
author
asLody
committed
Fix: issue #3 on 32bit device.
1 parent eb95d53 commit 828fceb

File tree

5 files changed

+1
-7
lines changed

5 files changed

+1
-7
lines changed

built/Android/arm64-v8a/libwhale.so

-1.19 MB
Binary file not shown.

built/Android/armeabi-v7a/libwhale.so

-786 KB
Binary file not shown.

built/Android/x86/libwhale.so

-1.04 MB
Binary file not shown.

built/Android/x86_64/libwhale.so

-1.08 MB
Binary file not shown.

whale/src/platform/linux/process_map.cc

+1-7
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,14 @@ void
4747
ForeachMemoryRange(std::function<bool(uintptr_t, uintptr_t, char *, char *)> callback) {
4848
FILE *f;
4949
if ((f = fopen("/proc/self/maps", "r"))) {
50-
char buf[PATH_MAX], perm[12], dev[12], mapname[PATH_MAX];
50+
char buf[PATH_MAX], perm[12] = {'\0'}, dev[12] = {'\0'}, mapname[PATH_MAX] = {'\0'};
5151
uintptr_t begin, end, inode, foo;
5252

5353
while (!feof(f)) {
5454
if (fgets(buf, sizeof(buf), f) == 0)
5555
break;
56-
mapname[0] = '\0';
57-
#if defined(__LP64__)
5856
sscanf(buf, "%lx-%lx %s %lx %s %ld %s", &begin, &end, perm,
5957
&foo, dev, &inode, mapname);
60-
#else
61-
sscanf(buf, "%x-%x %s %x %s %d %s", &begin, &end, perm,
62-
&foo, dev, &inode, mapname);
63-
#endif
6458
if (!callback(begin, end, perm, mapname)) {
6559
break;
6660
}

0 commit comments

Comments
 (0)