diff options
author | Petri Hintukainen <phintuka@users.sourceforge.net> | 2011-10-10 00:52:08 +0300 |
---|---|---|
committer | Petri Hintukainen <phintuka@users.sourceforge.net> | 2011-10-10 00:52:08 +0300 |
commit | 83049ca9ad0d39a5795b586b76f954748a3de316 (patch) | |
tree | 3e4697c79d570f079e1d28573d7fa47b9edb2b66 /src/xine-utils/utils.c | |
parent | 68a893cefd56a81ff3af304cda6ee897a1506ed3 (diff) | |
download | xine-lib-83049ca9ad0d39a5795b586b76f954748a3de316.tar.gz xine-lib-83049ca9ad0d39a5795b586b76f954748a3de316.tar.bz2 |
Added asprintf wrapper
Diffstat (limited to 'src/xine-utils/utils.c')
-rw-r--r-- | src/xine-utils/utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 3d21a2935..82cf5c0d4 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -706,6 +706,18 @@ char *xine_strcat_realloc (char **dest, char *append) return newstr; } +char *_x_asprintf(const char *format, ...) +{ + va_list ap; + char *buf = NULL; + + va_start (ap, format); + if (vasprintf (&buf, format, ap) < 0) + buf = NULL; + va_end (ap); + + return buf; +} int _x_set_file_close_on_exec(int fd) { |