- snprintf(vl.type_instance, sizeof(vl.type_instance), "%s-%s",
- res->instance_prefix, instances_str);
-
- if ('\0' != vl.type_instance[sizeof(vl.type_instance) - 1]) {
- vl.type_instance[sizeof(vl.type_instance) - 1] = '\0';
+ r = snprintf(vl.type_instance, sizeof(vl.type_instance), "%s-%s",
+ res->instance_prefix, instances_str);
+ if (r >= sizeof(vl.type_instance))