Fix order of footer in the output string array

The footer would override the first entries of the body because the
index pointer was not updated after copying the body strings to the
output array