File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
branches/try/src/libstd/sys/windows Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: 93616af42f4770edd681245933455ace84de5c02
4
+ refs/heads/try: 14b7591ee578042da43f6a9968034f4998cf291c
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -74,16 +74,15 @@ pub fn error_string(errnum: i32) -> String {
74
74
langId,
75
75
buf. as_mut_ptr ( ) ,
76
76
buf. len ( ) as DWORD ,
77
- ptr:: null ( ) ) ;
77
+ ptr:: null ( ) ) as usize ;
78
78
if res == 0 {
79
79
// Sometimes FormatMessageW can fail e.g. system doesn't like langId,
80
80
let fm_err = errno ( ) ;
81
81
return format ! ( "OS Error {} (FormatMessageW() returned error {})" ,
82
82
errnum, fm_err) ;
83
83
}
84
84
85
- let b = buf. iter ( ) . position ( |& b| b == 0 ) . unwrap_or ( buf. len ( ) ) ;
86
- match String :: from_utf16 ( & buf[ ..b] ) {
85
+ match String :: from_utf16 ( & buf[ ..res] ) {
87
86
Ok ( mut msg) => {
88
87
// Trim trailing CRLF inserted by FormatMessageW
89
88
let len = msg. trim_right ( ) . len ( ) ;
You can’t perform that action at this time.
0 commit comments