summaryrefslogtreecommitdiffstats
path: root/compat/asprintf.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2011-01-21 20:03:18 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2011-01-21 20:03:18 +0000
commite34c6fd187360b2427547772f1e9013bcb519b3d (patch)
treecc01650cefc4283aa08598a2a242b41e8143631b /compat/asprintf.c
parentac01c2025a2a3e054a5f30c7943cf785b2e566fc (diff)
Only have one asprintf implementation, that's likely to always work.
Diffstat (limited to 'compat/asprintf.c')
-rw-r--r--compat/asprintf.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/compat/asprintf.c b/compat/asprintf.c
index d5f50e85..d7c6ec99 100644
--- a/compat/asprintf.c
+++ b/compat/asprintf.c
@@ -1,4 +1,4 @@
-/* $Id: asprintf.c,v 1.5 2011-01-07 00:35:13 nicm Exp $ */
+/* $Id: asprintf.c,v 1.6 2011-01-21 20:03:18 nicm Exp $ */
/*
* Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -40,28 +40,6 @@ asprintf(char **ret, const char *format, ...)
return (n);
}
-#ifndef BROKEN_VSNPRINTF
-int
-vasprintf(char **ret, const char *format, va_list ap)
-{
- int n;
-
- if ((n = vsnprintf(NULL, 0, format, ap)) < 0)
- goto error;
-
- *ret = xmalloc(n + 1);
- if ((n = vsnprintf(*ret, n + 1, format, ap)) < 0) {
- xfree(*ret);
- goto error;
- }
-
- return (n);
-
-error:
- *ret = NULL;
- return (-1);
-}
-#else
int
vasprintf(char **ret, const char *fmt, va_list ap)
{
@@ -90,4 +68,3 @@ vasprintf(char **ret, const char *fmt, va_list ap)
len *= 2;
}
}
-#endif