about summary refs log tree commit diff
path: root/lib/util/vasprintf.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-12-25 20:40:38 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-12-25 20:40:38 +0000
commitca4e5d91a96387bc270692f520b5a30c09856c16 (patch)
tree3b90d98f59c6d2e48c68aa07c4768d5a3642b0b1 /lib/util/vasprintf.c
parente8724e9798d00fac3326f03ff9fdd616bdc8fce6 (diff)
downloadnetpbm-mirror-ca4e5d91a96387bc270692f520b5a30c09856c16.tar.gz
netpbm-mirror-ca4e5d91a96387bc270692f520b5a30c09856c16.tar.xz
netpbm-mirror-ca4e5d91a96387bc270692f520b5a30c09856c16.zip
Update Advanced series to 10.69
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2351 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/util/vasprintf.c')
-rw-r--r--lib/util/vasprintf.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/util/vasprintf.c b/lib/util/vasprintf.c
index e38252fa..a947f763 100644
--- a/lib/util/vasprintf.c
+++ b/lib/util/vasprintf.c
@@ -6,6 +6,8 @@
 #include <string.h>
 
 #include "pm_config.h"
+#include "pm_c_util.h"
+
 #include "nstring.h"
 
 
@@ -38,6 +40,12 @@ pm_vasprintf(const char ** const resultP,
 
        So instead, we just allocate 4K and truncate or waste as
        necessary.
+
+       Note that we don't recognize the floating point specifiers (%f, %e, %g)
+       - we render them as 'f', 'e', and 'g'.  It would be too much work to
+       make this code handle those, just for the few systems on which it runs.
+       Instead, we have pm_vasprintf_knows_float(), and any caller that cares
+       enough can avoid using these specifiers where they don't work.
     */
     size_t const allocSize = 4096;
     result = malloc(allocSize);
@@ -56,3 +64,14 @@ pm_vasprintf(const char ** const resultP,
     }
 #endif
 }
+
+
+
+bool
+pm_vasprintf_knows_float(void) {
+#if HAVE_VASPRINTF
+    return true;
+#else
+    return false;
+#endif
+}