diff options
Diffstat (limited to 'stdio-common')
-rw-r--r-- | stdio-common/Makefile | 24 | ||||
-rw-r--r-- | stdio-common/printf-parsemb.c | 1 | ||||
-rw-r--r-- | stdio-common/stdio_ext.h | 18 | ||||
-rw-r--r-- | stdio-common/tst-scanf-format-ss.h | 2 | ||||
-rw-r--r-- | stdio-common/vfscanf-internal.c | 2 |
5 files changed, 36 insertions, 11 deletions
diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 64b3575..ae2b90c 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -759,6 +759,30 @@ CFLAGS-tst-scanf-binary-gnu89.c += -std=gnu89 -DOBJPFX=\"$(objpfx)\" CPPFLAGS += $(libio-mtsafe) +make-tst-freopen4-out = \ + $(run-program-prefix-before-env) \ + $(run-program-env) \ + MALLOC_TRACE=$(@:.out=.mtrace) \ + LD_PRELOAD=$(common-objpfx)malloc/libc_malloc_debug.so \ + $(run-program-prefix-after-env) $< + +freopen4-temp-dir-before = warning: could not remove temporary file: +freopen4-temp-dir-after = : No such file or directory + +$(objpfx)tst-freopen4.out: $(objpfx)tst-freopen4 + $(make-tst-freopen4-out) > $@ && \ + grep "$(freopen4-temp-dir-before)" $@ \ + | sed -e "s/$(freopen4-temp-dir-before)//; s/$(freopen4-temp-dir-after)//" \ + | xargs rm -rf; \ + $(evaluate-test) + +$(objpfx)tst-freopen64-4.out: $(objpfx)tst-freopen64-4 + $(make-tst-freopen4-out) > $@ && \ + grep "$(freopen4-temp-dir-before)" $@ \ + | sed -e "s/$(freopen4-temp-dir-before)//; s/$(freopen4-temp-dir-after)//" \ + | xargs rm -rf; \ + $(evaluate-test) + $(objpfx)tst-setvbuf1.out: /dev/null $(objpfx)tst-setvbuf1 $(test-program-cmd) > $@ 2>&1; \ $(evaluate-test) diff --git a/stdio-common/printf-parsemb.c b/stdio-common/printf-parsemb.c index aad697a..a7ba52a 100644 --- a/stdio-common/printf-parsemb.c +++ b/stdio-common/printf-parsemb.c @@ -17,6 +17,7 @@ <https://www.gnu.org/licenses/>. */ #include <ctype.h> +#include <errno.h> #include <limits.h> #include <stdlib.h> #include <string.h> diff --git a/stdio-common/stdio_ext.h b/stdio-common/stdio_ext.h index 3a9a981..397b37f 100644 --- a/stdio-common/stdio_ext.h +++ b/stdio-common/stdio_ext.h @@ -43,43 +43,43 @@ __BEGIN_DECLS /* Return the size of the buffer of FP in bytes currently in use by the given stream. */ -extern size_t __fbufsize (FILE *__fp) __THROW; +extern size_t __fbufsize (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff the stream FP is opened readonly, or if the last operation on the stream was a read operation. */ -extern int __freading (FILE *__fp) __THROW; +extern int __freading (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff the stream FP is opened write-only or append-only, or if the last operation on the stream was a write operation. */ -extern int __fwriting (FILE *__fp) __THROW; +extern int __fwriting (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff stream FP is not opened write-only or append-only. */ -extern int __freadable (FILE *__fp) __THROW; +extern int __freadable (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff stream FP is not opened read-only. */ -extern int __fwritable (FILE *__fp) __THROW; +extern int __fwritable (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff the stream FP is line-buffered. */ -extern int __flbf (FILE *__fp) __THROW; +extern int __flbf (FILE *__fp) __THROW __nonnull ((1)); /* Discard all pending buffered I/O on the stream FP. */ -extern void __fpurge (FILE *__fp) __THROW; +extern void __fpurge (FILE *__fp) __THROW __nonnull ((1)); /* Return amount of output in bytes pending on a stream FP. */ -extern size_t __fpending (FILE *__fp) __THROW; +extern size_t __fpending (FILE *__fp) __THROW __nonnull ((1)); /* Flush all line-buffered files. */ extern void _flushlbf (void); /* Set locking status of stream FP to TYPE. */ -extern int __fsetlocking (FILE *__fp, int __type) __THROW; +extern int __fsetlocking (FILE *__fp, int __type) __THROW __nonnull ((1)); __END_DECLS diff --git a/stdio-common/tst-scanf-format-ss.h b/stdio-common/tst-scanf-format-ss.h index 2fb1ca2..b35e5bc 100644 --- a/stdio-common/tst-scanf-format-ss.h +++ b/stdio-common/tst-scanf-format-ss.h @@ -1,4 +1,4 @@ -/* Test feature wrapper for formatted 'scanf' input. +/* Test feature wrapper for formatted 'sscanf' input. Copyright (C) 2025 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c index b965c7b..86ae501 100644 --- a/stdio-common/vfscanf-internal.c +++ b/stdio-common/vfscanf-internal.c @@ -1737,7 +1737,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr, #endif } - if (n < 10) + if (n < num_digits_len) { /* Found it. */ from_level = level; |