Changed patch wording

This commit is contained in:
Joshua Landau 2015-06-11 18:10:25 +01:00
parent b107af3ada
commit 2148567821

View file

@ -311,7 +311,8 @@ impl ExactSizeIterator for Args {
impl Drop for Args {
fn drop(&mut self) {
// NULL-safe
// self.cur can be null if CommandLineToArgvW previously failed,
// but LocalFree ignores NULL pointers
unsafe { c::LocalFree(self.cur as *mut c_void); }
}
}
@ -322,8 +323,9 @@ pub fn args() -> Args {
let lpCmdLine = c::GetCommandLineW();
let szArgList = c::CommandLineToArgvW(lpCmdLine, &mut nArgs);
// cur may be NULL if CommandLineToArgvW failed,
// in which case the range is empty to prevent reads
// szArcList can be NULL if CommandLinToArgvW failed,
// but in that case nArgs is 0 so we won't actually
// try to read a null pointer
Args { cur: szArgList, range: 0..(nArgs as isize) }
}
}