Fixes: 9607d499dcdd09160b13 ("util: add asprintf() wrapper for MSVC")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
}
#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