aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-25 02:13:27 +0000
committerDavid Robillard <d@drobilla.net>2011-12-25 02:13:27 +0000
commitb2effabfc5d02bab56bae00e7aa138a42bd7d3b6 (patch)
treeba2e9ab5af305b9661fc4e0e79318b8c6676cb85 /src/node.c
parent2501f12f80c3eebed55e5b253ced5a29ac443949 (diff)
downloadserd-b2effabfc5d02bab56bae00e7aa138a42bd7d3b6.tar.gz
serd-b2effabfc5d02bab56bae00e7aa138a42bd7d3b6.tar.bz2
serd-b2effabfc5d02bab56bae00e7aa138a42bd7d3b6.zip
100% test coverage.
git-svn-id: http://svn.drobilla.net/serd/trunk@276 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/node.c b/src/node.c
index fbcbe1f5..59839e34 100644
--- a/src/node.c
+++ b/src/node.c
@@ -134,11 +134,7 @@ serd_node_new_uri(const SerdURI* uri, const SerdURI* base, SerdURI* out)
node.n_bytes = actual_len;
node.n_chars = actual_len;
- // FIXME: double parse
- if (serd_uri_parse(buf, out)) {
- fprintf(stderr, "Failed to parse URI <%s>\n", buf);
- return SERD_NODE_NULL;
- }
+ serd_uri_parse(buf, out); // TODO: cleverly avoid double parse
return node;
}
@@ -201,7 +197,7 @@ serd_node_new_integer(long i)
{
long abs_i = labs(i);
const long digits = (long)fmax(1.0, ceil(log10((double)abs_i + 1)));
- char* buf = calloc(digits + 1, 1);
+ char* buf = calloc(digits + 2, 1);
SerdNode node = { (const uint8_t*)buf, 0, 0, 0, SERD_LITERAL };
// Point s to the end