raspberrypi: fix math inside of sizeof
Move the subtraction of 1 for terminator outside of sizeof operator.
Closes #2731.