fixed sprintf opcode due to not resetting i variable