mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
Fix str.zfill() on empty string
This commit is contained in:
parent
6bb26e0187
commit
c96b292a82
@ -591,7 +591,7 @@ class str:
|
||||
fill = width - len(self)
|
||||
p = zf.ptr
|
||||
|
||||
if p[fill] == plus or p[fill] == minus:
|
||||
if len(self) > 0 and p[fill] == plus or p[fill] == minus:
|
||||
p[0] = p[fill]
|
||||
p[fill] = zero
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user