py/mpprint: Fix int formatting so "+" is printed for 0-valued integer.

This commit is contained in:
Damien George 2017-03-15 17:25:12 +11:00
parent 8cd4911e63
commit d65371538d
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int base_char
char prefix_buf[4]; char prefix_buf[4];
char *prefix = prefix_buf; char *prefix = prefix_buf;
if (mp_obj_int_sign(x) > 0) { if (mp_obj_int_sign(x) >= 0) {
if (flags & PF_FLAG_SHOW_SIGN) { if (flags & PF_FLAG_SHOW_SIGN) {
*prefix++ = '+'; *prefix++ = '+';
} else if (flags & PF_FLAG_SPACE_SIGN) { } else if (flags & PF_FLAG_SPACE_SIGN) {