by s_gourichon · 1y ago · 0 comments
I had a bug:
u_printf( my_output_cb, NULL, "%d" NL, -42 );
prints:--42
I may have found an explanation. In u_parse_format(), case 'i': calls u_itoa( value, buffer, 10, false ); which outputs minus sign.
Then if ( number ) does if ( sign ) { output_cb( '-', ctx ); chars_written++; } which outputs another minus sign.