- /* In case we requested one attribute only but got
- * several times into that attr loop, we need to append
- * the additional values. (This may happen if you derive
- * attributeTypes B and C from A and then query for A.)
- * In all other cases we detect the different attribute
- * and append only every non first value. */
- if ((attr_count == 1 && data) || (values != firstval))
- data = string_cat(data, &size, &ptr, US",", 1);
+ /* In case we requested one attribute only but got several times
+ into that attr loop, we need to append the additional values.
+ (This may happen if you derive attributeTypes B and C from A and
+ then query for A.) In all other cases we detect the different
+ attribute and append only every non first value. */
+
+ if (data && valuecount > 1)
+ data = string_catn(data, US",", 1);