fix wrong result for putc variants due to operator precedence