ao-tools: Use array indexing instead of addition to make gcc-10 happy
authorKeith Packard <keithp@keithp.com>
Fri, 17 Apr 2020 19:51:13 +0000 (12:51 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 17 Apr 2020 19:54:56 +0000 (12:54 -0700)
commitc2acda26c1e4e0d7ffda9cd985180562f61aa88b
tree304013ed33b0d23a34df020851fb45d6aa46c818
parent769f0e6049ae0440cf32f8cb0b5e504f67f5e911
ao-tools: Use array indexing instead of addition to make gcc-10 happy

A struct with a trailing zero-length array (for variable-length data) is
treated as a zero-sized object when doing pointer arithmetic, but treated
correctly when treated as an array. This generates a warning from gcc-10

load->data + address - load->address

while this, which is 'the same', does not:

&load->data[address - load->address]

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/lib/ao-editaltos.c