summaryrefslogtreecommitdiff
path: root/src/snprintf.c
Commit message (Collapse)AuthorAgeFilesLines
* Supporess worning to allow YAJL2 to use long long in APIDave Beckett2020-09-071-2/+2
|
* Define _GNU_SOURCE it not already setDave Beckett2017-01-081-0/+2
|
* [c++] Test pointer against NULL rather than use as implicit boolDave Beckett2017-01-081-2/+2
|
* OpenBSD fixesDave Beckett2015-05-021-3/+2
|
* Disable "-Wformat-nonliteral" with GCC pragma for snprintf test codeDave Beckett2014-11-231-0/+3
|
* (raptor_locator_format): Add a NUL to terminate output string.Dave Beckett2014-05-091-0/+2
| | | | | See librdf commit aa3bf4ccf4cc9381a1c198566428812af28944de that works around this.
* Tru64 V4.0G compatibility fixesDaniel Richard G2013-10-291-1/+4
|
* Remove all traces of win32_raptor_config.hDaniel Richard G2012-08-301-4/+0
| | | | | Remove the file itself, all #include uses of it, and all references to it, as this file is no longer needed.
* Prototypes for test functions to remove GCC format warningsDave Beckett2012-06-081-0/+3
|
* Add snprintf module simple unit testsDave Beckett2012-06-081-0/+91
|
* Portability improvements to vsnprintf code and macrosDave Beckett2012-06-061-14/+27
| | | | | | | | | | | | | | | | | | (vsnprintf_check_is_c99): Initialize len to -1 when the variable is declared instead of in the macro to remove redundancy. (vsnprintf_is_c99): Check that len < size before looking at tmp_buffer[len] otherwise we may be looking past the buffer size. (macro VSNPRINTF_NOT_C99_BLOCK): free tmp_buffer when breaking out of the while(1) loop. set len to a non-negative value in the buffer != NULL case (raptor_vsnprintf2): Initialize len to -1 here instead of in the VSNPRINTF_NOT_C99_BLOCK() macro. Return -1 if format is NULL. (raptor_vasprintf): Copy var args to re-use them when calling raptor_vsnprintf2()
* (raptor_vsnprintf2): Fix uninitialized variable problems in non-c99 variant. ↵Lauri Aalto2012-05-231-6/+6
| | | | | | | | | Thanks to John Emmas for reporting. * Compute len internally using int, not size_t as standard vsnprintf() returns ints anyway. This fixes for negative value comparison. Cast from size_t to int required for strlen() return value. * Initialize len earlier * Use passed in size if a buffer is given
* (raptor_format_integer): cast for comparing width to lenDave Beckett2012-03-111-1/+1
|
* (raptor_format_integer): Return size_t for this internal function.Dave Beckett2012-03-061-3/+3
|
* autodocsDave Beckett2011-11-131-1/+1
|
* Removed calls to trunc() and lround() and optional linking of libmDave Beckett2011-09-081-122/+0
| | | | | | | (raptor_format_float): Removed unused internal function and thus removed the only need for trunc() and lround(). configure: Removed checks for trunc(), lround() in libc or libm.
* Make raptor_format_integer handle hex tooDave Beckett2011-09-081-56/+21
| | | | | | | | | (raptor_format_integer): Add base, width and padding fields (raptor_format_hexadecimal): Deleted, replaced by above with base = 16. Updated all callers of above with new parameters.
* Add more RAPTOR_GOOD_CAST and RAPTOR_BAD_CAST and fix some.Dave Beckett2011-08-311-2/+2
|
* (raptor_format_hexadecimal): Added for formatting uppercase hex in aDave Beckett2011-08-311-1/+49
| | | | | | | | | fixed width field. (raptor_iostream_hexadecimal_write): Use raptor_format_hexadecimal() (raptor_xml_escape_string_any): Use raptor_format_hexadecimal() to remove a sprintf for &#xXX.
* Use RAPTOR_BAD_CAST and RAPTOR_GOOD_CASTDave Beckett2011-08-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Some good uses: - narrowing a known, checked unicode char to a U16 Some 'bad' uses: - only handing error messages, literal language, qname prefixes of a max len constrained by int - passing in data to libxml constrained by int max len - locator column field constrained to int size Some bad uses: - iostream read_bytes and write-bytes methods return int but could easily return a lot more in the size_t range (compare to fread). API change needed. - locator byte field constrained to int size. should be size_t - raptor_nfc_check returns int offset into a buffer that could be larger raptor_ntriples_parser_context changed line_length and offset to size_t raptor_turtle_parser changed buffer_length to size_t
* snprintf return code and size guessing fixesDave Beckett2011-08-301-6/+6
| | | | | | | | | | | vsnprintf_is_c99 macro: start guessing length from len strlen(format) and grow size by 50% each loop to hopefully get big enough faster. (raptor_vsnprintf): Error out when raptor_vasprintf result < 0 (raptor_snprintf): Note error is < 0 response (raptor_vasprintf): Error out when raptor_vsnprintf2 result is < 0
* (raptor_format_integer): AddedDave Beckett2011-08-281-0/+54
|
* autodocsDave Beckett2011-08-271-0/+2
|
* Define -D_GNU_SOURCE to get vasprintf()Dave Beckett2011-08-271-0/+3
|
* Portability fixes to snprintf / vsnprintf / vasprintfDave Beckett2011-08-271-3/+249
| | | | | | | | | | | | | (raptor_vsnprintf2): Added with actual vsnprintf() calling contention, deprecating raptor_vsnprintf which doesn't (raptor_snprintf): Added with snprintf() calling convention using raptor_vsnprintf2() to provide a portable version. (raptor_vasprintf): Added with vasprintf() calling convention (GNU) using raptor_vsnprintf2() to implement it if not present. Moved the formatted printing code all to src/snprintf.c
* Compile a local lround() if it is not present.Dave Beckett2011-08-211-0/+22
|
* (raptor_format_float): use a long for the intpart.Dave Beckett2011-07-241-4/+4
|
* Switch to raptor2.h as main header. raptor.h includes itDave Beckett2011-04-261-1/+1
|
* Code style - whitespace around assignment and comparison opsDave Beckett2010-01-051-5/+5
|
* Define round() and trunc() as macros if they were not found by configure as ↵Dave Beckett2007-10-251-0/+10
| | | | functions/macros. They were standardised with C99.
* Define __USE_ISOC99 to 1Dave Beckett2007-09-041-1/+1
|
* just leave raptor_format_float for now.Dave Beckett2007-08-281-613/+7
|
* raptor_format_float not publicDave Beckett2007-08-261-1/+1
|
* #ifdef out unused dopr_outch prototypeDave Beckett2007-08-051-0/+2
|
* (raptor_format_float): Renamed from fmtfp and edited to be XSD rules.Dave Beckett2007-08-051-158/+91
|
* style, ANSI C and std headersDave Beckett2007-06-241-139/+120
|
* Import Public Domain snprintf from mutt: ↵Dave Beckett2007-06-241-0/+799
http://dev.mutt.org/hg/mutt/file/55cd4cb611d9/snprintf.c Last Modified: Tue Aug 08 22:49:12 2006 +0000.