1
0
mirror of https://github.com/golang/go synced 2024-11-12 10:30:23 -07:00

lib9: format %#04x, 0 as 0x0000 not 000000.

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
This commit is contained in:
Russ Cox 2014-07-23 10:17:47 -04:00
parent 8b20e7bb7e
commit d4d50b5f01

View 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)){