diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2011-01-21 20:03:18 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2011-01-21 20:03:18 +0000 |
commit | e34c6fd187360b2427547772f1e9013bcb519b3d (patch) | |
tree | cc01650cefc4283aa08598a2a242b41e8143631b | |
parent | ac01c2025a2a3e054a5f30c7943cf785b2e566fc (diff) | |
download | rtmux-e34c6fd187360b2427547772f1e9013bcb519b3d.tar.gz rtmux-e34c6fd187360b2427547772f1e9013bcb519b3d.tar.bz2 rtmux-e34c6fd187360b2427547772f1e9013bcb519b3d.zip |
Only have one asprintf implementation, that's likely to always work.
-rw-r--r-- | compat/asprintf.c | 25 |
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 |