From e5ec04602ccc08aa45d8a9e60d9bcb476d3f9655 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 6 Aug 2016 21:21:56 +0200 Subject: [PATCH] src/utils_db_query.c: Correctly handle return value of strjoin(). It returns the number of bytes, not zero, on success. This fixes a bug introduced in 496ca2b758344bc6372ab0adf98ad8050f69b25a. --- src/utils_db_query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils_db_query.c b/src/utils_db_query.c index 9a168739..5fbdfd13 100644 --- a/src/utils_db_query.c +++ b/src/utils_db_query.c @@ -238,7 +238,7 @@ static int udb_result_submit (udb_result_t *r, /* {{{ */ { int status = strjoin (vl.type_instance, sizeof (vl.type_instance), r_area->instances_buffer, r->instances_num, "-"); - if (status != 0) + if (status < 0) { ERROR ("udb_result_submit: creating type_instance failed with status %d.", status); @@ -251,7 +251,7 @@ static int udb_result_submit (udb_result_t *r, /* {{{ */ int status = strjoin (tmp, sizeof (tmp), r_area->instances_buffer, r->instances_num, "-"); - if (status != 0) + if (status < 0) { ERROR ("udb_result_submit: creating type_instance failed with status %d.", status); -- 2.30.2