aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-02-01 00:51:34 +0000
committerDavid Robillard <d@drobilla.net>2012-02-01 00:51:34 +0000
commit550b05f7aad38a25e8ccd3414040f5db894c893c (patch)
tree05e2c6a9db05926d8764a0887f091610084e29cf /src/reader.c
parent713dc6669fb29fcebba51f01ee9eebf64cd2b86b (diff)
downloadserd-550b05f7aad38a25e8ccd3414040f5db894c893c.tar.gz
serd-550b05f7aad38a25e8ccd3414040f5db894c893c.tar.bz2
serd-550b05f7aad38a25e8ccd3414040f5db894c893c.zip
Fix jumps past variable initialization.
git-svn-id: http://svn.drobilla.net/serd/trunk@299 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/reader.c b/src/reader.c
index 60296b8f..e365e45f 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -794,6 +794,7 @@ read_uriref(SerdReader* reader)
static Ref
read_qname(SerdReader* reader, Ref dest, bool read_prefix)
{
+ Ref str = 0;
if (!dest) {
dest = push_node(reader, SERD_CURIE, "", 0);
}
@@ -802,7 +803,7 @@ read_qname(SerdReader* reader, Ref dest, bool read_prefix)
}
TRY_THROW(eat_byte_check(reader, ':'));
push_byte(reader, dest, ':');
- Ref str = read_name(reader, dest, false);
+ str = read_name(reader, dest, false);
return str ? str : dest;
except:
pop_node(reader, dest);
@@ -1303,17 +1304,18 @@ read_base(SerdReader* reader)
static bool
read_prefixID(SerdReader* reader)
{
+ bool ret = true;
+ Ref name = 0;
+ Ref uri = 0;
// `@' is already eaten in read_directive
eat_string(reader, "prefix", 6);
TRY_RET(read_ws_plus(reader));
- bool ret = true;
- Ref name = read_prefixName(reader, 0);
+ name = read_prefixName(reader, 0);
if (!name) {
name = push_node(reader, SERD_LITERAL, "", 0);
}
TRY_THROW(eat_byte_check(reader, ':') == ':');
read_ws_star(reader);
- Ref uri = 0;
TRY_THROW(uri = read_uriref(reader));
if (reader->prefix_sink) {
ret = !reader->prefix_sink(reader->handle,