diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-07-07 18:25:30 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-07-07 18:25:30 +0100 |
commit | 176583ebf1b7c4a503c1ecc88123c15d3414d46b (patch) | |
tree | b00b2061b386fc929b08150870f208fee2bebacb /test/testutils/utils.c | |
parent | a72ba64abdd90ad1fd9476aa354046927a75f7a7 (diff) | |
parent | e03978c667b83627073498ca34c61cf267934c41 (diff) | |
download | libdom-176583ebf1b7c4a503c1ecc88123c15d3414d46b.tar.gz libdom-176583ebf1b7c4a503c1ecc88123c15d3414d46b.tar.bz2 |
Merge element work, adds 5 element types and enables 27 tests.
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; +} |