aboutsummaryrefslogtreecommitdiffstats
path: root/sctrace.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sctrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sctrace.c b/sctrace.c
index 8be566f..3a29e2e 100644
--- a/sctrace.c
+++ b/sctrace.c
@@ -63,7 +63,7 @@ get_string(pid_t pid, unsigned long int addr, size_t *lenp, const char **errorp)
struct iovec inv, outv;
size_t off = 0, size = 0, page_off, read_size;
char *out = NULL, *in = (char *)addr, *p;
- page_off = (size_t)addr - ((size_t)addr & -sizeof(PAGE_SIZE));
+ page_off = (size_t)addr % sizeof(PAGE_SIZE);
read_size = PAGE_SIZE - page_off;
*errorp = NULL;
for (;; read_size = PAGE_SIZE) {