- for (int attempts = 0; attempts < 2; attempts++) {
- if (rb_snprintf_try_append(buf_list[i], max_list, "%s%s%s",
- buf_list[i][0] == '\0' ? "" : " ", /* space between caps */
- type,
- cap->cap) < 0
- && buf_list[i][0] != '\0') {
-
- if (!(source_p->flags & FLAGS_CLICAP_DATA)) {
- /* the client doesn't support multiple lines */
- break;
- }
-
- /* doesn't fit in the buffer, move to the next one */
- if (i < 2) {
- i++;
- } else {
- /* uh-oh */
- break;
- }
-
- /* reset the buffer and go around the loop one more time */
- buf_list[i][0] = '\0';
- } else {
- break;
- }
- }