summaryrefslogtreecommitdiffstats
path: root/str.c
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-01-09 21:56:07 +0100
committerMartin Nagy <mnagy@redhat.com>2009-01-09 21:56:07 +0100
commit2c173cfea94028290965d01df22bc24761cfbe65 (patch)
tree4c87b4aac1c1b83b0fa3567ef8887827c6b3b40d /str.c
parentaabe778f87f5bfb51bbf8a9703ed83f0fdd7e660 (diff)
downloadldap_driver_testing-2c173cfea94028290965d01df22bc24761cfbe65.tar.gz
ldap_driver_testing-2c173cfea94028290965d01df22bc24761cfbe65.tar.xz
ldap_driver_testing-2c173cfea94028290965d01df22bc24761cfbe65.zip
Add util.h.
Diffstat (limited to 'str.c')
-rw-r--r--str.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/str.c b/str.c
index 4655320..d553c66 100644
--- a/str.c
+++ b/str.c
@@ -33,6 +33,7 @@
#include <string.h>
#include "str.h"
+#include "util.h"
#define IGNORE(expr) if (expr) return
@@ -40,11 +41,6 @@
#define ALLOC_BASE_SIZE 16
-#define CHECK(op) \
- do { result = (op); \
- if (result != ISC_R_SUCCESS) goto cleanup; \
- } while (0)
-
/* Custom string, these shouldn't use these directly */
struct ld_string {
@@ -74,6 +70,7 @@ str_alloc(ld_string_t *str, size_t len)
char *new_buffer;
REQUIRE(str != NULL);
+ REQUIRE(str->mctx != NULL);
IGNORE_R(str->allocated > len);
len++; /* Account for the last '\0'. */