diff options
author | Marcus Brinkmann <mb@g10code.com> | 2004-01-30 13:37:09 +0100 |
---|---|---|
committer | Marcus Brinkmann <mb@g10code.com> | 2004-01-30 13:37:09 +0100 |
commit | 0f7a19f3b0e91861dc962780c4738453764247ce (patch) | |
tree | 15b244295ec01996b85891945005214fe23404c4 /common/miscellaneous.c | |
parent | 2004-01-30 Marcus Brinkmann <marcus@g10code.de> (diff) | |
download | gnupg2-0f7a19f3b0e91861dc962780c4738453764247ce.tar.xz gnupg2-0f7a19f3b0e91861dc962780c4738453764247ce.zip |
2004-01-30 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libcommon_a_SOURCES): Add xasprintf.c.
* miscellaneous.c (xasprintf): Moved to ...
* xasprintf (xasprintf): ... here. New file.
This allows to use xasprintf without sucking in gpg-error.
Diffstat (limited to 'common/miscellaneous.c')
-rw-r--r-- | common/miscellaneous.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/common/miscellaneous.c b/common/miscellaneous.c index 4937bd7ce..86b0fcb3a 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -25,25 +25,6 @@ #include "util.h" #include "iobuf.h" -/* Same as asprintf but return an allocated buffer suitable to be - freed using xfree. This function simply dies on memory failure, - thus no extra check is required. */ -char * -xasprintf (const char *fmt, ...) -{ - va_list ap; - char *buf, *p; - - va_start (ap, fmt); - if (vasprintf (&buf, fmt, ap) < 0) - log_fatal ("asprintf failed: %s\n", strerror (errno)); - va_end (ap); - p = xstrdup (buf); - free (buf); - return p; -} - - /* Decide whether the filename is stdout or a real filename and return * an appropriate string. */ |