about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-07-16 19:35:17 +0000
committerEric Wong <e@80x24.org>2018-07-16 21:14:13 +0000
commitb7173a191ad477219b713cb5e3d2815ca8ab290f (patch)
tree441535fc3821284ab8dd8f6979a9a60c48cd119b
parent23a6354cb74b5f0e61ea39776d7cefc9570b07d6 (diff)
downloadmwrap-b7173a191ad477219b713cb5e3d2815ca8ab290f.tar.gz
glibc will place the (virtual) address at the end, and this allows us to
find addresses for programs which put '[' in their progname (e.g. ssh,
mogilefsd, unicorn, avahi, ...)
-rw-r--r--ext/mwrap/mwrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mwrap/mwrap.c b/ext/mwrap/mwrap.c
index 421c086..0a1f9b5 100644
--- a/ext/mwrap/mwrap.c
+++ b/ext/mwrap/mwrap.c
@@ -839,7 +839,7 @@ extract_addr(const char *str, size_t len, void **p)
 {
         const char *c;
 #if defined(__GLIBC__)
-        return ((c = memchr(str, '[', len)) && sscanf(c, "[%p]", p));
+        return ((c = memrchr(str, '[', len)) && sscanf(c, "[%p]", p));
 #else /* tested FreeBSD */
         return ((c = strstr(str, "0x")) && sscanf(c, "%p", p));
 #endif