From e34c6fd187360b2427547772f1e9013bcb519b3d Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 21 Jan 2011 20:03:18 +0000 Subject: [PATCH] Only have one asprintf implementation, that's likely to always work. --- compat/asprintf.c | 25 +------------------------ 1 file changed, 1 insertion(+), 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 @@ -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