From 687c09042ffb9c9a18d1b673cfbd3eeae2aca25d Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 22 Apr 2019 17:29:26 +0000 Subject: [PATCH] ar: use array notation to access s_so This is somewhat more readable than pointer arithmetic. Also remove an unnecessary cast while here. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- usr.bin/ar/write.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index fe6f3dec55e..66d776e5c80 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -673,11 +673,11 @@ write_objs(struct bsdar *bsdar) for (i = 0; (size_t)i < bsdar->s_cnt; i++) { if (w_sz == sizeof(uint32_t)) - *(bsdar->s_so + i) = - htobe32((uint32_t)(*(bsdar->s_so + i)) + pm_sz); + bsdar->s_so[i] = + htobe32(bsdar->s_so[i] + pm_sz); else - *(bsdar->s_so + i) = - htobe64(*(bsdar->s_so + i) + pm_sz); + bsdar->s_so[i] = + htobe64(bsdar->s_so[i] + pm_sz); } }