]> Cypherpunks repositories - gostls13.git/commitdiff
lib9: format %#04x, 0 as 0x0000 not 000000.
authorRuss Cox <rsc@golang.org>
Wed, 23 Jul 2014 14:17:47 +0000 (10:17 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 23 Jul 2014 14:17:47 +0000 (10:17 -0400)
This matches Go's fmt.Printf instead of ANSI C's dumb rules.
It makes the -S output from C liblink match Go's liblink.

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/112600043

src/lib9/fmt/dofmt.c

index 94a91a2aac2e0aff09838616349cff7bd8d715e2..3b9dc361213707b16fa72c07be3cd30cb9ce9a68 100644 (file)
@@ -491,12 +491,6 @@ __ifmt(Fmt *f)
                        if(fl & FmtApost)
                                __needsep(&ndig, &grouping);
                }
-
-               /*
-                * Zero values don't get 0x.
-                */
-               if(f->r == 'x' || f->r == 'X')
-                       fl &= ~(ulong)FmtSharp;
        }
        for(w = f->prec; n < w && p > buf+3; n++){
                if((fl & FmtApost) && __needsep(&ndig, &grouping)){