summaryrefslogtreecommitdiffstats
path: root/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* libc: add missing lock initialization in vswprintfMaksim Rayskiy2011-06-291-0/+5
| | | | | | | | | | | | | Unlike vsnprintf, vswprintf does not properly initialize locking elements of FILE structure, which in some unfortunate cases can result in lockups in _vfwprintf_internal. Interesting, the initialization code was removed in 2a915734a32c5aec9a6a76c13bcb074d30e64171 at the same time as it was added to vsnprintf. Signed-off-by: Maksim Rayskiy <mrayskiy@broadcom.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* remove unused hidden functionsPeter S. Mazinger2011-03-092-2/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* make parse_printf_format() depend on UCLIBC_HAS_GLIBC_CUSTOM_PRINTFPeter S. Mazinger2011-03-031-0/+4
| | | | | | we already remove the printf.h header if this option is disabled Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* *printf: Violation of precision with null stringJones Desougi2011-02-091-0/+6
| | | | | | | | | | | | | | | | | | When a string format is processed and the argument is NULL, this yields "(null)" regardless of precision. This does not make sense, precision should not be exceeded. A simple test shows that glibc outputs nothing if precision is smaller than six and the attached patch implements this same behaviour. Consider the not uncommon case of strings implemented like this: struct string { int len; char *ptr; }; There is often no nultermination and they may be printed like this: printf("%.*s", string.len, string.ptr); If len is 0 then ptr may be anything, but NULL is a common value. Obviously the empty string would be expected, not "(null)". Signed-off-by: Jones Desougi <jones.desougi@27m.se> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stdio: fix diagnostic messageBernhard Reutner-Fischer2011-01-211-1/+1
| | | | | | harmless copy'n paste error in #error Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* __psfs_parse_spec: always use long int for %pBernhard Reutner-Fischer2011-01-111-1/+4
| | | | | closes bug #3037 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* vfprintf.c: reduce a chunk of #ifdef forest and remove one goto inside itDenys Vlasenko2010-10-191-21/+20
| | | | | | No code changes according to objdump. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* _vfprintf.c: de-obfuscate badly twisted fragment. no code changes.Denys Vlasenko2010-10-191-5/+3
| | | | | | objdump confirms that I did not mess it up. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* vfprintf.c: remove endif comments which clog up the source. no code changesDenys Vlasenko2010-10-191-136/+135
| | | | | | | | | | Example: --ppfs->maxposarg; Verified with objdump that no code is changed Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* vfprintf.c: de-obfuscate if(with nested assignments). no logic changesDenys Vlasenko2010-10-191-25/+38
| | | | | | | God knows this file is hard to read as-is, some readability improvement is in order. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* _uintmaxtostr: fix indentation (spaces->tabs), no code changesDenys Vlasenko2010-08-261-10/+10
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Merge commit 'origin/master' into nptlAustin Foxley2010-04-022-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | 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>
| * prettify make cleanBernhard Reutner-Fischer2010-03-251-2/+2
| | | | | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * lift printf field width limitMichael Deutschmann2010-03-171-4/+4
| | | | | | | | | | | | | | | | | | | | uClibc mishandles printf field width limits larger than 40959, as a result of misguided overflow-protection code. This causes spurious test failures with GNU coreutils, which depends on "%65536s" and "%20000000f" working according to spec. Signed-off-by: Michael Deutschmann <michael@talamasca.ocis.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Extend __gen_tempname with mode argumentMikhail Gusarov2009-11-094-4/+5
| | | | | | | | | | | | | | | | | | | | sem_open(3) needs to create a temporary file in a way which can't be efficiently implemented in terms of POSIX API. Extend __gen_tempname with mode_t mode argument in order to ease sem_open implementation. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* | use *_not_cancel variants to avoid accidental cancellations with nptlAustin Foxley2009-10-171-1/+2
| | | | | | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* | rework internal uClibc mutexes to support futex locking, and nptlAustin Foxley2009-10-177-24/+32
|/ | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* remove a few more empty #if/#endif pairsDenys Vlasenko2009-09-194-14/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* convert // comments to /**/; remove empty #if/#endif pairs. no code changesDenys Vlasenko2009-09-185-24/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer2009-09-1876-209/+0
| | | | | | | | sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* remove(): slight readabability tweak, no code changesDenys Vlasenko2009-09-051-5/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* support building out-of-treeBernhard Reutner-Fischer2009-08-171-0/+2
| | | | | | Handle O= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* suppress bogus ioctl on fd==INT_MAX when vasprintf() is calledDenis Vlasenko2009-02-154-14/+23
|
* *: remove __UCLIBC_CURLOCALE_DATA, __UCLIBC_CURLOCALE_DATA.xDenis Vlasenko2009-01-214-30/+30
| | | | | | | | | | | | | | | | | | | is always equivalent to __UCLIBC_CURLOCALE->x. remove typedef __uclibc_locale_t, it used only in a few places, it is lees confusing to use struct __uclibc_locale_struct everywhere. xlocale.h: hide __global_locale back under _LIBC, bug 53 is wrong in claiming it should be exported. Also hide under _LIBC: extern __locale_t __curlocale_var; extern __locale_t __curlocale(void); extern __locale_t __curlocale_set(__locale_t newloc); # define __UCLIBC_CURLOCALE # define __XL_NPP(N) # define __LOCALE_PARAM # define __LOCALE_ARG # define __LOCALE_PTR
* more of warning fixes, mostly pointer signedness mismatchesDenis Vlasenko2008-12-213-7/+8
|
* more of pointer signedness warnings removedDenis Vlasenko2008-12-211-4/+4
|
* heed multiple warnings of the typeDenis Vlasenko2008-12-211-7/+8
| | | | | | libc/stdio/_vfprintf.c:1892: warning: passing argument 1 of '_[w]stdio_fwrite' from incompatible pointer type
* libc/stdio/_scanf.c: heed lots of warnings about signed/unsigned charsDenis Vlasenko2008-12-201-24/+12
| | | | | | and such; remove two unneeded static string (inline "str" works better code-size wise).
* fix improperly hidden fputc_unlockedDenis Vlasenko2008-11-292-4/+2
|
* fix improperly hidden fwprintf.Denis Vlasenko2008-11-291-0/+1
| | | | | | | | | make two data objects static. text data bss dec hex filename - 274779 1835 19012 295626 482ca lib/libuClibc-0.9.30-svn.so + 274693 1835 19012 295540 48274 lib/libuClibc-0.9.30-svn.so
* fix some unneeded PLT referencesDenis Vlasenko2008-11-222-2/+2
|
* Last portion of libc_hidden_proto removal.Denis Vlasenko2008-11-2063-143/+143
| | | | | Appears to build fine (several .configs tried)
* next portion of libc_hidden_proto removalDenis Vlasenko2008-11-2018-24/+24
|
* libc_hidden_proto removal, a few more functionsDenis Vlasenko2008-11-189-13/+13
|
* libc_hidden_proto removal, just a few functionsDenis Vlasenko2008-11-186-6/+6
|
* - less verbose make cleanBernhard Reutner-Fischer2008-11-071-4/+4
|
* - Fix __user_locking with stdio buffers (Carmelo AMOROSO)Bernhard Reutner-Fischer2008-11-021-1/+1
| | | | Closes #5254
* Fix up memset() argument ordering in open_memstream(). PreviouslyPaul Mundt2008-09-211-2/+2
| | | | | | parts of the buffers were not being zeroed out as expected. Reported by Dmytro Gorbunov <dmitro.gorbunov@gmail.com>.
* Fix some locale multibyte tests failures ad below:Carmelo Amoroso2008-09-091-3/+0
| | | | | | | | | | | libc/stdlib/_strtod.c -> tst_wcstod; libc/stdlib/stdlib.c -> tst_mblen, tst_mbtowc, tst_wctomb; libc/stdio/_scanf.c -> tst_swscanf; libc/string/strncmp.c -> tst_wcsncmp; libc/misc/wchar/wchar.c -> tst_mbrlen, tst_mbrtowc, tst_wcswidth. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Fix problem in vfprintf when assertion are enabled.Carmelo Amoroso2008-09-091-2/+1
| | | | | | | | | | | Here follow the output of my analysis: __stdio_fwrite expects at least 1 bytes. fputs_unlocked(S,F) calls fwrite_unlocked and this calls __stdio_fwrite only if bytes to be written are > 0, otherwise simply returs 0 (that is correct). During the parsing of format spec it could happen that __stdio_fwrite is called passing an empty string and with assertion enabled it will abort. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* - trim any trailing whitespaceBernhard Reutner-Fischer2008-07-2310-30/+30
|
* Remove __PRINTF_INFO_NO_BITFIELD hack, UCLIBC_INTERNAL can be used instead,Denis Vlasenko2008-06-032-4/+0
| | | | | | | | | and it's slightly shorter. Also removes stray macros from public <printf.h> header and uses spaces for comment indentation. No code changes (verified with objdump).
* suppress a few "might be used uninitialized" warnings. No code growth.Denis Vlasenko2008-06-011-2/+2
|
* - Avoid warning about undefined preprocessor token. No obj-code changes.Bernhard Reutner-Fischer2008-05-302-2/+2
|
* - avoid warning about cast from pointer to integer of different sizeBernhard Reutner-Fischer2008-05-231-1/+1
|
* - for non-threaded, non-macro case we were missing __GI_fputc (for e.g. error.c)Bernhard Reutner-Fischer2008-05-231-0/+2
|
* replace "if (p) free(p)" by just "free(p)" - free(NULL) is safe.Denis Vlasenko2008-05-201-3/+1
|
* Moving libc_hidden_proto's into #ifdef UCLIBC_INTERNAL blockDenis Vlasenko2008-05-1914-25/+25
| | | | | | | | | in string.h and strings.h. This caught unguarded string ops in libc/inet/ethers.c __ether_line_w() function. I will wait for fallout reports for a week or so, then continue converting more libc_hidden_proto's.
* remove "register" from _vf[w]printf_internal declarations tooDenis Vlasenko2008-04-101-2/+2
|
* even more fixes for vda-made breakage in vXXXfprintfDenis Vlasenko2008-04-103-15/+12
| | | | | (pointed out by Peter S.Mazinger)