diff options
author | Mattias Andrée <maandree@kth.se> | 2020-05-30 12:57:15 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-05-30 12:57:15 +0200 |
commit | 557784751f11b790258068fcba6c277bf5a7ee58 (patch) | |
tree | f271dfb161d21b05cd83e8474188381876b64ead | |
parent | Use process_vm_readv instead of PTRACE_PEEKDATA (no fallback) (diff) | |
download | sctrace-557784751f11b790258068fcba6c277bf5a7ee58.tar.gz sctrace-557784751f11b790258068fcba6c277bf5a7ee58.tar.bz2 sctrace-557784751f11b790258068fcba6c277bf5a7ee58.tar.xz |
Minor simplification
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | sctrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |