Skip to content
Snippets Groups Projects
Commit 021a8e00 authored by 8tab's avatar 8tab
Browse files

Fix stdio/scanf test case

inner_scanf prematurely exited before parsing collected string
parent a7480ea6
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,7 @@ unsafe fn inner_scanf(
r.commit();
width = width.map(|w| w - 1);
if width.map(|w| w > 0).unwrap_or(true) && !read!() {
return Ok(matched);
break;
}
}
......
......@@ -33,7 +33,7 @@ void test(char* fmt_in, char* input, struct params *p, ...) {
int main(void) {
struct params p = { .c = 'a' };
test("%hhd %d", "12 345", &p, &p.sa, &p.ia);
test("%hd %d", "12 345", &p, &p.sa, &p.ia);
test("%x %i %i", "12 0x345 010", &p, &p.ia, &p.ib, &p.ic);
test("%f.%lf", "0.1.0.2", &p, &p.fa, &p.da);
test("%p", "0xABCDEF", &p, &p.ptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment