From 05f9e858a5dd4b3a1ba5047aa703e55da70dcfdf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 11 Jul 2016 19:30:04 -0400 Subject: Improve test coverage --- src/state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 9bc1d6d..137d1a7 100644 --- a/src/state.c +++ b/src/state.c @@ -1,5 +1,5 @@ /* - Copyright 2007-2015 David Robillard + Copyright 2007-2016 David Robillard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -106,18 +106,18 @@ append_port_value(LilvState* state, uint32_t size, uint32_t type) { + PortValue* pv = NULL; if (value) { state->values = (PortValue*)realloc( state->values, (++state->n_values) * sizeof(PortValue)); - PortValue* pv = &state->values[state->n_values - 1]; + pv = &state->values[state->n_values - 1]; pv->symbol = lilv_strdup(port_symbol); pv->value = malloc(size); pv->size = size; pv->type = type; memcpy(pv->value, value, size); - return pv; } - return NULL; + return pv; } static const char* -- cgit v1.2.1