Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
track more int/str confusion when checking truthness in sprintf
  • Loading branch information
FROGGS committed Apr 10, 2015
1 parent d7b8b06 commit 7238985
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HLL/sprintf.nqp
Expand Up @@ -340,7 +340,7 @@ my module sprintf {
method directive:sym<o>($/) {
my $int := intify(next_argument($/));
$int := nqp::base_I($int, 8);
my $pre := '0' if $int && has_flag($/, 'hash');
my $pre := '0' if $int ne '0' && has_flag($/, 'hash');
if nqp::chars($<precision>) {
$int := '' if $<precision>.made == 0 && $int == 0;
$int := $pre ~ infix_x('0', intify($<precision>.made) - nqp::chars($int)) ~ $int;
Expand Down Expand Up @@ -376,7 +376,7 @@ my module sprintf {
method directive:sym<x>($/) {
my $int := intify(next_argument($/));
$int := nqp::base_I($int, 16);
my $pre := '0X' if $int && has_flag($/, 'hash');
my $pre := '0X' if $int ne '0' && has_flag($/, 'hash');
if nqp::chars($<precision>) {
$int := '' if $<precision>.made == 0 && $int == 0;
$int := $pre ~ infix_x('0', $<precision>.made - nqp::chars($int)) ~ $int;
Expand Down

0 comments on commit 7238985

Please sign in to comment.