Code

utils_db_query.c: r->instances_num is unsigned
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 08:42:52 +0000 (10:42 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 08:42:52 +0000 (10:42 +0200)
[src/utils_db_query.c:237]: (style) Checking if unsigned variable 'instances_num' is less than zero.

src/utils_db_query.c

index 74c3a81fe7c69d8052f1ce54baae71e70a6547ac..1f5ea7ab839761fd89d31fbc46ca5c452c1294e8 100644 (file)
@@ -234,7 +234,7 @@ static int udb_result_submit (udb_result_t *r, /* {{{ */
   sstrncpy (vl.type, r->type, sizeof (vl.type));
 
   /* Set vl.type_instance {{{ */
-  if (r->instances_num <= 0)
+  if (r->instances_num == 0)
   {
     if (r->instance_prefix == NULL)
       vl.type_instance[0] = 0;