mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-03 12:35:02 +00:00
The function fwscanf() return value is wrong when encountering an early
matching failure. According to the Open Group documentation for fwscanf: "Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure." Without this change, fwscanf would return EOF in the case of an early matching failure, instead of the proper return value of 0. This change aligns fwscanf(3) with the implementation in fscanf(3). PR: 202240 Submitted by: rajendra.sy@gmail.com Reviewed by: jhb, cem Approved by: sjg (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13288
This commit is contained in:
parent
b00a5bd558
commit
8b17691466
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326635
@ -494,7 +494,7 @@ again: c = *fmt++;
|
||||
goto input_failure;
|
||||
if (wi != c) {
|
||||
__ungetwc(wi, fp, locale);
|
||||
goto input_failure;
|
||||
goto match_failure;
|
||||
}
|
||||
nread++;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user