changed wscanf parameters

This commit is contained in:
Nicolás Antinori
2025-02-06 19:58:54 -03:00
parent 18659e821f
commit 61c31f348c
2 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -1008,7 +1008,7 @@ pub unsafe extern "C" fn wmemset(ws: *mut wchar_t, wc: wchar_t, n: size_t) -> *m
}
#[no_mangle]
pub unsafe extern "C" fn wscanf(format: *const wchar_t, ap: va_list) -> c_int {
pub unsafe extern "C" fn wscanf(format: *const wchar_t, mut __valist: ...) -> c_int {
let mut file = (*stdin).lock();
if let Err(_) = file.try_set_byte_orientation_unlocked() {
return -1;
@@ -1016,7 +1016,7 @@ pub unsafe extern "C" fn wscanf(format: *const wchar_t, ap: va_list) -> c_int {
let f: &mut FILE = &mut *file;
let reader: LookAheadReader = f.into();
wscanf::scanf(reader, format, ap)
wscanf::scanf(reader, format, __valist.as_va_list())
}
#[no_mangle]
+5 -3
View File
@@ -92,9 +92,11 @@ int main ()
wprintf(L"%d \"%s\" \"%s\" \"%s\" \"%s\"\n", ret, &protobuf, &slashbuf, &hostbuf, &pathbuf);
// wchar_t str [80];
// wprintf(L"Enter your family name: ");
// wscanf(L"%ls",str);
// wchar_t str [80];
wchar_t wstring1[20];
wprintf(L"Enter your family name: ");
wscanf(L"%ls", wstring1);
wprintf (L"Mr. %ls, %d years old.\n", wstring1);
return 0;
}