Skip to content

Commit

Permalink
Fix str.zfill() on empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
arshajii committed Jul 5, 2023
1 parent 6bb26e0 commit c96b292
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/internal/str.codon
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c96b292

Please sign in to comment.