1
0
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:
A. R. Shajii 2023-07-04 23:52:10 -04:00
parent 6bb26e0187
commit c96b292a82

View File

@ -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