Skip to content

Commit e68a134

Browse files
committed
Deref pointers to actually operate on the argument
1 parent 6ad18eb commit e68a134

File tree

1 file changed

+2
-2
lines changed
  • src/libstd/sys/windows

1 file changed

+2
-2
lines changed

src/libstd/sys/windows/os.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,14 @@ unsafe fn os_string_from_ptr(ptr: *mut u16) -> OsString {
291291
impl Iterator for Args {
292292
type Item = OsString;
293293
fn next(&mut self) -> Option<OsString> {
294-
self.range.next().map(|i| os_string_from_ptr(self.cur.offset(i)))
294+
self.range.next().map(|i| os_string_from_ptr(unsafe { *self.cur.offset(i) }))
295295
}
296296
fn size_hint(&self) -> (usize, Option<usize>) { self.range.size_hint() }
297297
}
298298

299299
impl DoubleEndedIterator for Args {
300300
fn next_back(&mut self) -> Option<OsString> {
301-
self.range.next_back().map(|i| os_string_from_ptr(self.cur.offset(i)))
301+
self.range.next_back().map(|i| os_string_from_ptr(unsafe { *self.cur.offset(i) }))
302302
}
303303
}
304304

0 commit comments

Comments
 (0)