]> Cypherpunks repositories - gostls13.git/commit
scan: permit base prefixes 0nnn and 0xnn when scanning
authorRob Pike <r@golang.org>
Fri, 4 Feb 2011 21:14:38 +0000 (13:14 -0800)
committerRob Pike <r@golang.org>
Fri, 4 Feb 2011 21:14:38 +0000 (13:14 -0800)
commit6e615a57af895f1d4f7f7ff95d741b3f188fef5c
tree5e1c0b225a16d1f3ab2a7eec49a373dbfaf932f2
parentc14c4e55e00ff06b83063cc2117444a2d75a3b0d
scan: permit base prefixes 0nnn and 0xnn when scanning
signed or unsigned integers using %v or the formatless scanner.
That is, Sscan("0x11", &i) or Sscanf("0x11", "%v", &i) will now
set i to 17.   If a format other than %v is presented, the behavior
is as before.

Fixes #1469.

R=rsc
CC=golang-dev
https://golang.org/cl/4131042
src/pkg/fmt/doc.go
src/pkg/fmt/scan.go
src/pkg/fmt/scan_test.go