diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-27 20:55:33 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-27 20:55:37 -0700 |
commit | bfb6044479e8e974e848f47969f75b84865fea13 (patch) | |
tree | d8631e32a64744389b9c6e2291ff901f771c0745 /utils.h | |
parent | 7848ba1d292f55553058c1f17596baa1094cdae5 (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.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |