- for (i = 0; i < numtrans; ++i) {
- int32_t len = utrans_getAvailableID(i, buf, buflen);
- if (len >= buflen - 1) {
- if (buf != staticbuf) {
- buflen <<= 1;
- if (buflen < len) {
- buflen = len + 64;
- }
- buf = (char *) uprv_realloc(buf, buflen);
- if (!buf) {
- buf = staticbuf;
- buflen = sizeof(staticbuf);
- }
- }
- utrans_getAvailableID(i, buf, buflen);
- if (len >= buflen) {
- uprv_strcpy(buf + buflen - 4, "..."); /* Truncate the name. */
- }
- }
-
- printf("%s", buf);