aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-07-16 23:16:57 -0500
committerRob Landley <rob@landley.net>2019-07-16 23:16:57 -0500
commit25bfbb69be6cb5577285cb58d14b1b0c2a09e7d1 (patch)
treee851fec8775cb214e722e694d611c0f37a459b26 /toys/posix
parentfdd58dc338b5d1797bb7f44f2602ed60b1c7b911 (diff)
downloadtoybox-25bfbb69be6cb5577285cb58d14b1b0c2a09e7d1.tar.gz
Fix unaligned access, tweak test suite.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/grep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/grep.c b/toys/posix/grep.c
index 54d72c13..6fd6bd2f 100644
--- a/toys/posix/grep.c
+++ b/toys/posix/grep.c
@@ -283,7 +283,7 @@ static void do_grep(int fd, char *name)
else {
while (dlb) {
struct double_list *dl = dlist_pop(&dlb);
- unsigned *uu = (void *)(dl->data+((strlen(dl->data)+1)|3));
+ unsigned *uu = (void *)(dl->data+(strlen(dl->data)|3)+1);
outline(dl->data, '-', name, lcount-before, uu[0]+1, uu[1]);
free(dl->data);
@@ -326,7 +326,7 @@ static void do_grep(int fd, char *name)
discard = 0;
}
if (discard && TT.B) {
- unsigned *uu, ul = (ulen+1)|3;
+ unsigned *uu, ul = (ulen|3)+1;
line = xrealloc(line, ul+8);
uu = (void *)(line+ul);