]> Cypherpunks repositories - gostls13.git/commit
fmt: check newline in the end of input
authorNodir Turakulov <nodir@google.com>
Wed, 21 Oct 2015 18:09:00 +0000 (11:09 -0700)
committerRob Pike <r@golang.org>
Mon, 23 Nov 2015 21:11:37 +0000 (21:11 +0000)
commit8331f19d9700457d74bf377755ca270a32d2faa3
tree9ba0c59d585657841f8a44bcaf794153b4f0f8cc
parentb89033399894776d677a4cecc82e2ac888fd7906
fmt: check newline in the end of input

Sscanf doc says:
Newlines in the input must match newlines in the format.

However Sscanf didn't check newline in the end of input (EOF).
A test for the case is broken.

* check newline in EOF
* fix the test
* slightly simplify ss.doScanf

Fixes #12788

Change-Id: Iaf6b7d81324a72e557543ac22ecea5cecb72e0d6
Reviewed-on: https://go-review.googlesource.com/16165
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/fmt/scan.go
src/fmt/scan_test.go