Skip to content

fmt: mishandling of FALSE in Scanf #2922

@gopherbot

Description

@gopherbot

by toqueteos:

What steps will reproduce the problem?
1. Reading from stdin a bool value using fmt.Scanf with %t
2. Write FLLSE
3. It works?!

What is the expected output?
Not a boolean value but is evaluated as false.

What do you see instead?
A falsy value.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux & Windows

Which revision are you using?  (hg identify)
go version weekly.2011-12-22 11071

Please provide any additional information below.

The error is located here
http://code.google.com/p/go/source/browse/src/pkg/fmt/scan.go#515

That first accept should be s.accept("aA") instead of s.accept("aL")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions