aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_string.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2004-08-14 03:45:45 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2004-08-14 03:45:45 +0000
commit57b665990ad3baa0b0fc0611984b502b3f8f26d5 (patch)
treec8c3ea449972625054a074cdd1e21e770642ffbb /lib/libarchive/archive_string.c
parentb295bdcded40d9a847451bc1654ec035c5256118 (diff)
Eliminate reliance on non-portable <err.h> by implementing a very
simple errx() function. Improve behavior when bzlib/zlib are missing by detecting and issuing an error message on attempts to read gzip/bzip2 compressed archives.
Notes
Notes: svn path=/head/; revision=133710
Diffstat (limited to 'lib/libarchive/archive_string.c')
-rw-r--r--lib/libarchive/archive_string.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libarchive/archive_string.c b/lib/libarchive/archive_string.c
index 323b611774f1..0e92836233c6 100644
--- a/lib/libarchive/archive_string.c
+++ b/lib/libarchive/archive_string.c
@@ -32,10 +32,10 @@ __FBSDID("$FreeBSD$");
* strings while minimizing heap activity.
*/
-#include <err.h>
#include <stdlib.h>
#include <string.h>
+#include "archive_private.h"
#include "archive_string.h"
struct archive_string *
@@ -68,8 +68,10 @@ __archive_string_ensure(struct archive_string *as, size_t s)
while (as->buffer_length < s)
as->buffer_length *= 2;
as->s = realloc(as->s, as->buffer_length);
+ /* TODO: Return null instead and fix up all of our callers to
+ * handle this correctly. */
if (as->s == NULL)
- errx(1,"Out of memory");
+ __archive_errx(1, "Out of memory");
return (as);
}