fix format specifier compiler warning
fix c89 variable declaration