diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-07-07 15:13:39 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-07-07 15:13:39 +0100 |
commit | 4a4a68d432a41038397d44faaebf23c05f7d544a (patch) | |
tree | 4afd9af130ff4ab8854633d99db04b11bf50bfff /test/testutils/utils.c | |
parent | 1d4e7737b413ba1736b7f1b929e4355c2d750a6e (diff) | |
download | libdom-4a4a68d432a41038397d44faaebf23c05f7d544a.tar.gz libdom-4a4a68d432a41038397d44faaebf23c05f7d544a.tar.bz2 |
DOMTS: Add proper support for assertURIEquals
Diffstat (limited to 'test/testutils/utils.c')
-rw-r--r-- | test/testutils/utils.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/testutils/utils.c b/test/testutils/utils.c index 739933f..c876613 100644 --- a/test/testutils/utils.c +++ b/test/testutils/utils.c @@ -8,6 +8,7 @@ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "utils.h" @@ -31,4 +32,10 @@ void mymsg(uint32_t severity, void *ctx, const char *msg, ...) fprintf(stderr, "\n"); } - +char *domts_strndup(const char *s, size_t len) +{ + size_t retlen = min(strlen(s), len); + char *ret = calloc(retlen + 1, 1); + memcpy(ret, s, retlen); + return ret; +} |