Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(484)

Side by Side Diff: src/pkg/fmt/scan.go

Issue 2144043: code review 2144043: fmt.Scan: fix integer overflow on 32-bit machines (Closed)
Patch Set: code review 2144043: fmt.Scan: fix integer overflow on 32-bit machines Created 14 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/fmt/scan_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package fmt 5 package fmt
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "io" 9 "io"
10 "os" 10 "os"
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 *v = s.scanComplex(verb, 128) 733 *v = s.scanComplex(verb, 128)
734 case *int: 734 case *int:
735 *v = int(s.scanInt(verb, intBits)) 735 *v = int(s.scanInt(verb, intBits))
736 case *int8: 736 case *int8:
737 *v = int8(s.scanInt(verb, 8)) 737 *v = int8(s.scanInt(verb, 8))
738 case *int16: 738 case *int16:
739 *v = int16(s.scanInt(verb, 16)) 739 *v = int16(s.scanInt(verb, 16))
740 case *int32: 740 case *int32:
741 *v = int32(s.scanInt(verb, 32)) 741 *v = int32(s.scanInt(verb, 32))
742 case *int64: 742 case *int64:
743 » » *v = s.scanInt(verb, intBits) 743 » » *v = s.scanInt(verb, 64)
744 case *uint: 744 case *uint:
745 *v = uint(s.scanUint(verb, intBits)) 745 *v = uint(s.scanUint(verb, intBits))
746 case *uint8: 746 case *uint8:
747 *v = uint8(s.scanUint(verb, 8)) 747 *v = uint8(s.scanUint(verb, 8))
748 case *uint16: 748 case *uint16:
749 *v = uint16(s.scanUint(verb, 16)) 749 *v = uint16(s.scanUint(verb, 16))
750 case *uint32: 750 case *uint32:
751 *v = uint32(s.scanUint(verb, 32)) 751 *v = uint32(s.scanUint(verb, 32))
752 case *uint64: 752 case *uint64:
753 *v = s.scanUint(verb, 64) 753 *v = s.scanUint(verb, 64)
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 field := a[numProcessed] 936 field := a[numProcessed]
937 937
938 s.scanOne(c, field) 938 s.scanOne(c, field)
939 numProcessed++ 939 numProcessed++
940 } 940 }
941 if numProcessed < len(a) { 941 if numProcessed < len(a) {
942 s.errorString("too many operands") 942 s.errorString("too many operands")
943 } 943 }
944 return 944 return
945 } 945 }
OLDNEW
« no previous file with comments | « no previous file | src/pkg/fmt/scan_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b