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

pull/2960/head
Damien George 2017-03-15 17:25:12 +11:00
rodzic 8cd4911e63
commit d65371538d
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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 = prefix_buf;
if (mp_obj_int_sign(x) > 0) {
if (mp_obj_int_sign(x) >= 0) {
if (flags & PF_FLAG_SHOW_SIGN) {
*prefix++ = '+';
} else if (flags & PF_FLAG_SPACE_SIGN) {