summaryrefslogtreecommitdiffstats
path: root/src/util/u_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/u_string.h')
-rw-r--r--src/util/u_string.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/util/u_string.h b/src/util/u_string.h
index e7163927667..5fea8f17e73 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -99,16 +99,15 @@ util_vasprintf(char **ret, const char *format, va_list ap)
}
#define asprintf util_asprintf
-static inline char *
-util_asprintf(const char *fmt, ...)
+static inline int
+util_asprintf(char **str, const char *fmt, ...)
{
- char *ptr;
+ int ret;
va_list args;
va_start(args, fmt);
- if (vasprintf(&ptr, fmt, args) == -1)
- ptr = NULL;
+ ret = vasprintf(str, fmt, args);
va_end(args);
- return ptr;
+ return ret;
}
#define strcasecmp stricmp