Implement CVec, an abstraction to return vectors from Rust

This commit is contained in:
jD91mZM2
2019-07-18 06:39:50 +02:00
parent c85145b5d1
commit a2c8cfb4a5
5 changed files with 221 additions and 24 deletions
+1 -2
View File
@@ -404,8 +404,7 @@ unsafe fn inner_scanf<R: Read>(
let mut ptr: Option<*mut c_char> = if ignore { None } else { Some(ap.arg()) };
// While we haven't used up all the width, and it matches
while width.map(|w| w > 0).unwrap_or(true) && !invert == matches.contains(&byte)
{
while width.map(|w| w > 0).unwrap_or(true) && !invert == matches.contains(&byte) {
if let Some(ref mut ptr) = ptr {
**ptr = byte as c_char;
*ptr = ptr.offset(1);