| 760 | */ |
| 761 | |
| 762 | static void |
| 763 | add_stringf(cups_array_t *a, /* I - Array */ |
| 764 | const char *s, /* I - Printf-style format string */ |
| 765 | ...) /* I - Additional args as needed */ |
| 766 | { |
| 767 | char buffer[10240]; /* Format buffer */ |
| 768 | va_list ap; /* Argument pointer */ |
| 769 | |
| 770 | |
| 771 | /* |
| 772 | * Don't bother is the array is NULL... |
| 773 | */ |
| 774 | |
| 775 | if (!a) |
| 776 | return; |
| 777 | |
| 778 | /* |
| 779 | * Format the message... |
| 780 | */ |
| 781 | |
| 782 | va_start(ap, s); |
| 783 | vsnprintf(buffer, sizeof(buffer), s, ap); |
| 784 | va_end(ap); |
| 785 | |
| 786 | /* |
| 787 | * Add it to the array... |
| 788 | */ |
| 789 | |
| 790 | cupsArrayAdd(a, buffer); |
| 791 | } |
| 792 | |
| 793 | |
| 794 | /* |
no test coverage detected