From 557784751f11b790258068fcba6c277bf5a7ee58 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 30 May 2020 12:57:15 +0200 Subject: Minor simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- sctrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3-70-g09d2