ao-tools: Use array indexing instead of addition to make gcc-10 happy
[fw/altos] / ao-tools / lib / ao-editaltos.c
index 0600965309834527964843bedd596821ae93d40a..602390e3d324d7e0cb736d39f25b5b169d63b39d 100644 (file)
@@ -53,12 +53,10 @@ int ao_num_symbols = NUM_SYMBOLS;
 static bool
 rewrite(struct ao_hex_image *load, unsigned address, uint8_t *data, int length)
 {
-       int             i;
-
        if (address < load->address || load->address + load->length < address + length)
                return false;
 
-       memcpy(load->data + address - load->address, data, length);
+       memcpy(&load->data[address - load->address], data, length);
        return true;
 }