diff options
author | Austin Foxley <austinf@cetoncorp.com> | 2010-04-02 09:17:30 -0700 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2010-04-02 09:17:30 -0700 |
commit | aae3eb9256affb18cff589b52ee26e0a4e557bbd (patch) | |
tree | 003711a54e7dfbde0b50979e2942fd3e0d3451c8 /libc/stdio | |
parent | ef18cfe8ebab25f5ef92e81956f50e2dc57df602 (diff) | |
parent | 2864786ad884369ab5397be864e9f43d32bc2726 (diff) |
Merge commit 'origin/master' into nptl
Conflicts:
Makefile.in
extra/Configs/Config.in
libc/sysdeps/linux/common/bits/kernel-features.h
libc/sysdeps/linux/common/poll.c
libc/sysdeps/linux/common/sysdep.h
libc/sysdeps/linux/sh/sysdep.h
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/stdio')
-rw-r--r-- | libc/stdio/Makefile.in | 4 | ||||
-rw-r--r-- | libc/stdio/_vfprintf.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libc/stdio/Makefile.in b/libc/stdio/Makefile.in index 634b9a47d..1ca2dcff4 100644 --- a/libc/stdio/Makefile.in +++ b/libc/stdio/Makefile.in @@ -103,7 +103,7 @@ ifeq ($(UCLIBC_HAS_WCHAR),y) libc-nomulti-y += $(STDIO_OUT)/vfwprintf.o $(STDIO_OUT)/vfwscanf.o endif -objclean-y += stdio_clean +objclean-y += CLEAN_libc/stdio -stdio_clean: +CLEAN_libc/stdio: $(do_rm) $(addprefix $(STDIO_OUT)/*., o os oS) diff --git a/libc/stdio/_vfprintf.c b/libc/stdio/_vfprintf.c index f288cb501..6fa8ecb8d 100644 --- a/libc/stdio/_vfprintf.c +++ b/libc/stdio/_vfprintf.c @@ -161,9 +161,6 @@ /* Now controlled by uClibc_stdio.h. */ /* #define __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__ */ -/* TODO -- move these to a configuration section? */ -#define MAX_FIELD_WIDTH 4095 - #ifdef __UCLIBC_MJN3_ONLY__ #ifdef L_register_printf_function /* emit only once */ @@ -893,8 +890,11 @@ int attribute_hidden _ppfs_parsespec(ppfs_t *ppfs) } i = 0; while (isdigit(*fmt)) { - if (i < MAX_FIELD_WIDTH) { /* Avoid overflow. */ + if (i < INT_MAX / 10 + || (i == INT_MAX / 10 && (*fmt - '0') <= INT_MAX % 10)) { i = (i * 10) + (*fmt - '0'); + } else { + i = INT_MAX; /* best we can do... */ } ++fmt; } |