Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71e57d0

Browse files
committed
Fix the fix :-(
1 parent 6938a29 commit 71e57d0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Objects/stringobject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,8 @@ formatstring(format, args)
818818
res = getstringvalue(result) + reslen - rescnt;
819819
}
820820
if (sign) {
821+
if (fill != ' ')
822+
*res++ = sign;
821823
rescnt--;
822824
if (width > len)
823825
width--;
@@ -828,7 +830,7 @@ formatstring(format, args)
828830
*res++ = fill;
829831
} while (--width > len);
830832
}
831-
if (sign)
833+
if (sign && fill == ' ')
832834
*res++ = sign;
833835
memcpy(res, buf, len);
834836
res += len;

0 commit comments

Comments
 (0)