summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-27 20:55:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-27 20:55:37 -0700
commitbfb6044479e8e974e848f47969f75b84865fea13 (patch)
treed8631e32a64744389b9c6e2291ff901f771c0745 /utils.h
parent7848ba1d292f55553058c1f17596baa1094cdae5 (diff)
Replace several malloc+sprintf pairs with asprintf() calls
Includes fallback uAsprintf() for systems without asprintf yet Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index f37c8df..82c8c6b 100644
--- a/utils.h
+++ b/utils.h
@@ -95,6 +95,12 @@ extern void uInternalError(const char *s, ...) _X_ATTRIBUTE_PRINTF(1, 2);
#define uStringCompare(s1,s2) (strcmp(s1,s2))
#define uStrCaseEqual(s1,s2) (strcasecmp(s1,s2)==0)
+#ifndef HAVE_ASPRINTF
+extern _X_HIDDEN int _X_ATTRIBUTE_PRINTF(2,3)
+ uAsprintf(char ** ret, const char *format, ...);
+#define asprintf uAsprintf
+#endif
+
/***====================================================================***/
_XFUNCPROTOEND