aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/Makefile
diff options
context:
space:
mode:
authorAvinal Kumar <avinal.xlvii@gmail.com>2024-10-25 15:48:27 +0530
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-10-25 15:05:06 -0300
commit04e8698fcca7d1e932bc54f5b60e1bbce2e87601 (patch)
tree43b2939f0ef8a5abf808806137cd1e30b7217a28 /stdio-common/Makefile
parentac73067cb7a328bf106ecd041c020fc61be7e087 (diff)
downloadglibc-04e8698fcca7d1e932bc54f5b60e1bbce2e87601.tar.xz
glibc-04e8698fcca7d1e932bc54f5b60e1bbce2e87601.zip
stdio-common: Fix scanf parsing for NaN types [BZ #30647]
The scanf family of functions like sscanf and fscanf currently ignore nan() and nan(n-char-sequence). This happens because __vfscanf_internal only checks for 'nan'. This commit adds support for all valid nan types i.e. nan, nan() and nan(n-char-sequence), where n-char-sequence can be [a-zA-Z0-9_]+, thus fixing the bug 30647. Any other representation of NaN should result in conversion error. New tests are also added to verify the correct parsing of NaN types for float, double and long double formats. Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'stdio-common/Makefile')
-rw-r--r--stdio-common/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 88105b3c1b..a166eb7cf8 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -261,6 +261,7 @@ tests := \
tst-scanf-binary-gnu89 \
tst-scanf-bz27650 \
tst-scanf-intn \
+ tst-scanf-nan \
tst-scanf-round \
tst-scanf-to_inpunct \
tst-setvbuf1 \