Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virstring.c | 11 +++--------
src/util/virstring.h | 5 ++---
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/util/virstring.c b/src/util/virstring.c
index 24a9e41493..91b237f358 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -746,23 +746,18 @@ virVasprintfInternal(char **strp,
return ret;
}
-int
+void
virAsprintfInternal(char **strp,
const char *fmt, ...)
{
va_list ap;
- char *str = NULL;
- int ret;
va_start(ap, fmt);
- ret = g_vasprintf(&str, fmt, ap);
+ g_vasprintf(strp, fmt, ap);
va_end(ap);
- if (!*str)
+ if (!*strp)
abort();
- *strp = str;
-
- return ret;
}
/**
diff --git a/src/util/virstring.h b/src/util/virstring.h
index d7881be2d1..f595d0ad4c 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -133,9 +133,8 @@ int virStrdup(char **dest, const char *src)
int virStrndup(char **dest, const char *src, ssize_t n)
G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1);
-int virAsprintfInternal(char **strp, const char *fmt, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3)
- G_GNUC_WARN_UNUSED_RESULT;
+void virAsprintfInternal(char **strp, const char *fmt, ...)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3);
int virVasprintfInternal(char **strp, const char *fmt, va_list list)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 0)
G_GNUC_WARN_UNUSED_RESULT;
--
2.21.0