summaryrefslogtreecommitdiff
path: root/strings/apr_snprintf.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix indentjailletc362015-06-031-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1683221 13f79535-47bb-0310-9956-ffa450edef68
* fix some minor bugs and useless assignments so that clang scan-buildtrawick2013-10-231-1/+0
| | | | | | | is a little quieter git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1534882 13f79535-47bb-0310-9956-ffa450edef68
* Fix flag character '#' in combination with formatrjung2011-07-291-2/+2
| | | | | | | character 'x' in apr snprintf implementations. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1152309 13f79535-47bb-0310-9956-ffa450edef68
* quite warning...jim2011-01-191-2/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1060659 13f79535-47bb-0310-9956-ffa450edef68
* Fix cases where off_t (and APR_OFF_T_FMT) may be "larger" thanjim2011-01-171-3/+20
| | | | | | | int64 (and APR_INT64_T_FMT). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1060104 13f79535-47bb-0310-9956-ffa450edef68
* Silence GCC 4.3 warning (patch by jorton).bojan2008-05-271-1/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@660373 13f79535-47bb-0310-9956-ffa450edef68
* Document cvt from V7, not GNU libc, and copyrightjim2008-05-021-2/+2
| | | | | | | Caldera International Inc. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@652832 13f79535-47bb-0310-9956-ffa450edef68
* * Fix compiler warning for uninitialized variablerpluem2008-02-231-1/+1
| | | | | | | | Spotted by: Sebastian Gottschalk <seppig_relay gmx.de> Reviewed by: rpluem git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@630528 13f79535-47bb-0310-9956-ffa450edef68
* Introduce macro definitions of the min/max characteristics of the apr integerdavi2007-07-091-4/+4
| | | | | | | types. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@554692 13f79535-47bb-0310-9956-ffa450edef68
* Convert wide* types to the portable apr types. Conversion table:davi2007-07-061-65/+50
| | | | | | | | | | | | | wide_int apr_int32_t u_wide_int apr_uint32_t widest_int apr_int64_t u_widest_int apr_uint64_t bool_int int Passes testfmt. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@553679 13f79535-47bb-0310-9956-ffa450edef68
* Binary size apr_vformatter as bytes, K, M, T, etc, to a four character compacteddavi2007-06-291-0/+26
| | | | | | | human readable form. Based upon apr_strfsize. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@551923 13f79535-47bb-0310-9956-ffa450edef68
* Early assignment of the to-be-converted number yields better code and avoidsdavi2007-06-291-11/+3
| | | | | | | ugly casts. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@551922 13f79535-47bb-0310-9956-ffa450edef68
* APR_VOID_P_IS_QUAD is not defined anywhere and the usual way iswrowe2007-05-311-1/+1
| | | | | | | | | | using APR_SIZEOF_VOIDP. PR: 40758 Submitted by: Davi Arnaut <davi@haxent.com.br> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@543274 13f79535-47bb-0310-9956-ffa450edef68
* * strings/apr_snprintf.c (conv_10_quad): Fix formatting of unsignedjorton2007-04-261-1/+1
| | | | | | | | | | | | | integers between 2^63 and 2^64 on 32-bit platforms. * test/testfmt.c (more_int64_fmts): Test an even bigger unsigned int64. Submitted by: Wynn Wilkes <wynn bungeelabs.com> PR: 42250 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@532733 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.jorton2006-08-031-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.jorton2006-08-031-6/+6
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* * strings/apr_snprintf.c (apr_snprintf, apr_vsnprintf): Fix tojorton2006-07-111-2/+2
| | | | | | | | | | | | returning number of bytes *without* NUL in overflow case. * test/teststr.c (snprintf_overflow): New test case. PR: 39996 Submitted by: Michal Luczaj <regenrecht o2.pl> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@420858 13f79535-47bb-0310-9956-ffa450edef68
* * strings/apr_snprintf.c (conv_os_thread_t, conv_os_thread_t_hex):jorton2006-02-231-6/+8
| | | | | | | Avoid strict-aliasing warnings with gcc 4.1. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@380106 13f79535-47bb-0310-9956-ffa450edef68
* Eliminate a type mismatch, this is the smaller patch - changingwrowe2006-01-131-2/+2
| | | | | | | | the declaration of apr_gcvt() - an exported function, is much dicier. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@368548 13f79535-47bb-0310-9956-ffa450edef68
* Fix handling of %pI with psprintf; the psprintf implementation assumesjorton2005-09-081-2/+10
| | | | | | | | | | | | | | | | | | | that the vformatter code will not palloc. * include/apr_network_io.h (apr_sockaddr_ip_getbuf): Declare new function. * network_io/unix/sockaddr.c (apr_sockaddr_ip_getbuf): Rewrite of apr_sockaddr_ip_get, taking a buffer argument. (apr_sockaddr_ip_get): Reimplement using apr_sockaddr_ip_getbuf. * strings/apr_snprintf.c (conv_apr_sockaddr): Use apr_sockaddr_ip_getbuf to avoid use of pool. * test/testsock.c (test_print_addr): New test case. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@279566 13f79535-47bb-0310-9956-ffa450edef68
* Fix multiple sign'edness issues; for %width.prec variables, neitherwrowe2005-09-031-9/+11
| | | | | | | | | | is -ever- signed, we pull out -width as a flag, and prec is folded +. Changing the code only required special handling of %*.* variables, continuing to read them as int, and preserving the folding of negative values that's already there. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@267459 13f79535-47bb-0310-9956-ffa450edef68
* * strings/apr_snprintf.c (apr_vformatter): Add support for %pm tojorton2005-08-181-0/+19
| | | | | | | | | | | print the error string corresponding to an apr_status_t. * test/testfmt.c (error_fmt): New test. * include/apr_lib.h: Document %pm and note the versioning constraint. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@233381 13f79535-47bb-0310-9956-ffa450edef68
* Add %pt support to apr_snprintf() for printing an apr_os_thread_ttrawick2005-06-171-0/+46
| | | | | | | in hex format. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@191138 13f79535-47bb-0310-9956-ffa450edef68
* Buffer lengths in these internal functions must all be in apr_size_twrowe2005-05-161-13/+13
| | | | | | | quantums - to match the size of memory. Prevents many many ugly casts. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@170470 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.jerenkrantz2005-02-041-1/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* Fix apr_snprintf() to respect precision for small floating pointtrawick2004-06-271-1/+2
| | | | | | | | | | numbers. PR: 29621 Submitted by: Artur Zaprzala <zybi talex.pl> Reviewed by: Jeff Trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65222 13f79535-47bb-0310-9956-ffa450edef68
* * string/apr_snprintf.c (conv_10_quad): Fix formatting of integersjorton2004-04-041-1/+2
| | | | | | | | | smaller than LONG_MIN. * test/testfmt.c (more_int64_fmts): Add regression test. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65037 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0jerenkrantz2004-02-131-53/+10
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* * configure.in, include/apr.h.in, include/apr.hw, include/apr.hnw:jorton2003-10-011-10/+10
| | | | | | | | | | | | | | | Remove definitions of APR_INT64_T_FMT_LEN, APR_UINT64_T_FMT_LEN and APR_UINT64_T_HEX_FMT_LEN. Die at configure-time if a 64-bit integer type is not found rather than placing "#error"s in apr.h. * strings/apr_snprintf.c (apr_vformatter): Rework to use sizeof() rather than APR_INT64_T_FMT_LEN. One (intensional) functional change, for the sizeof(int) == 8 case: previously the first if condition would always be true since strncmp(a, b, 0) == 0; now the condition will always be false. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64675 13f79535-47bb-0310-9956-ffa450edef68
* In the case of invalid %p formats, skip the bogus argument too when skipping ↵martin2003-06-201-0/+1
| | | | | | the false format item git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64545 13f79535-47bb-0310-9956-ffa450edef68
* Add %pT support to apr_snprintf() for printing an apr_os_thread_t.trawick2003-04-171-0/+50
| | | | | | | (from a series of suggestions on #apr) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64485 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright notices to 2003.thommay2003-01-011-1/+1
| | | | | | | No functional changes git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
* A few NOTICEs for developers modifying code, not 'XXX' developer pointers.wrowe2002-12-101-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64136 13f79535-47bb-0310-9956-ffa450edef68
* Get rid of somewhat long-standing issue regarding large valuesjim2002-12-091-8/+10
| | | | | | | | | | | | of precision causing a buffer to be clobbered in the vformatter function (eg: apr_snprintf) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64132 13f79535-47bb-0310-9956-ffa450edef68
* fix typo before someone else notices it and pounces :)jim2002-08-271-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63835 13f79535-47bb-0310-9956-ffa450edef68
* Fix typo that broke things in really odd ways.jerenkrantz2002-08-271-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63834 13f79535-47bb-0310-9956-ffa450edef68
* Document the len == 0 special case for apr_snprintf() and allow it tojim2002-08-261-6/+24
| | | | | | | | | | | work no matter what buf is (NULL or not). PR: Obtained from: Submitted by: Reviewed by: rbb git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63832 13f79535-47bb-0310-9956-ffa450edef68
* If the length argument to apr_snprintf is 0, then we should return therbb2002-08-251-15/+15
| | | | | | | | | length that the string would be if we actually were going to fill it out. However, if the length argument is 0, we can also accept a NULL string. Also, added a test case for this. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63829 13f79535-47bb-0310-9956-ffa450edef68
* Printing a string with apr_snprintf can seg fault, if a precision isrbb2002-08-251-3/+32
| | | | | | | | | | | | | specified for the string, and the string being printed doesn't have a trailing '\0'. Fix that seg fault by not calling strlen if a precision is specified when printing a string. Also add a test to the test suite for this case. PR: 8554 Submitted by: R Samuel Klatchko <rsk@brightmail.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63828 13f79535-47bb-0310-9956-ffa450edef68
* Remove a bogus fixup from apr_vformatter, which made sure a NUL byte couldstriker2002-07-131-4/+1
| | | | | | | | | | | | | | | | | fit in by flushing if the final character was at the exact end of the buffer it was using. Take care of the case that the fixup was handling in apr_psprintf, by ensuring we can fit a NUL byte from the beginning. Implement this by calling flush if we start with a 0 byte buffer (in which nothing can fit anyway). Secondly make sure that the flush function never tries to use a block that has less than APR_PSPRINTF_MIN_STRINGSIZE bytes to spare. Thanks to Nuutti Kotivuori <naked@iki.fi> for pointing out the problem, digging around for answers and providing patches. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63654 13f79535-47bb-0310-9956-ffa450edef68
* A simple memcpy is sufficient here, because we know the length of thesascha2002-05-071-1/+2
| | | | | | | string. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63369 13f79535-47bb-0310-9956-ffa450edef68
* Optimize away a strncmp that accounted for 10% of the run time ofbrianp2002-05-071-0/+7
| | | | | | | apr_vformatter() git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63368 13f79535-47bb-0310-9956-ffa450edef68
* clean up the use of apr_sockaddr_t (stay out of family-specifictrawick2002-03-151-3/+2
| | | | | | | struct sockaddr* as much as possible) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63137 13f79535-47bb-0310-9956-ffa450edef68
* PR: 9932 (apache 1.3)jim2002-03-141-0/+4
| | | | | | | | | | Obtained from: Submitted by: Joshua Colvin <joshua@jammed.com> Reviewed by: Martin Kraemer, Jim Jagielski Bring up fix from 1.3 patch git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63121 13f79535-47bb-0310-9956-ffa450edef68
* Update our copyright for this year.fielding2002-03-131-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
* Formatting cleanup only - I'm now convince this code is clean - but somewrowe2002-02-121-2/+2
| | | | | | | | products may identify the va_args from apr_Xsprintf() calls as living on another fn's stack [true] and toss up memory violations [not true.] git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62948 13f79535-47bb-0310-9956-ffa450edef68
* You know the style was horrendous when it requires *two* passes to getjerenkrantz2002-02-051-43/+43
| | | | | | | a decent style. Sorry. No functional changes. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62914 13f79535-47bb-0310-9956-ffa450edef68
* Style changes - tabs to spaces primarily.jerenkrantz2002-02-051-679/+683
| | | | | | | | | No functional changes. (This file is a stylistic nightmare to read. We're seeing an OS/X stack smash with SVN. We need a reformat so we can understand it.) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62913 13f79535-47bb-0310-9956-ffa450edef68
* Sing, "we are apr"... and make all hash functions accept apr_ssize_twrowe2001-05-161-4/+4
| | | | | | | | if we are going to bury -1 flags (I'd prefer the flag cast to apr_size_t and use that value throughout the hash api, however.) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61649 13f79535-47bb-0310-9956-ffa450edef68
* Patch to allow %qd within apr_snprintf, but handle the platform specificwrowe2001-05-031-1/+7
| | | | | | | APR_INT64_T_FMT string regardless (e.g. older lld or win32 I64d). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61584 13f79535-47bb-0310-9956-ffa450edef68