-static void nntp_create_newsrc_line (nntp_data_t * data, char **buf,
- char **pline, ssize_t * buflen)
-{
- char *line = *pline;
- ssize_t len = *buflen - (*pline - *buf);
- int x, i;
-
- if (len < LONG_STRING * 10) {
- len += *buflen;
- *buflen *= 2;
- line = *buf;
- p_realloc(buf, *buflen);
- line = *buf + (*pline - line);
- }
- strcpy (line, data->group);
- len -= m_strlen(line) + 1;
- line += m_strlen(line);
- *line++ = data->subscribed ? ':' : '!';
- *line++ = ' ';
- *line = '\0';
-
- for (x = 0; x < data->num; x++) {
- if (len < LONG_STRING) {
- len += *buflen;
- *buflen *= 2;
- *pline = line;
- line = *buf;
- p_realloc(buf, *buflen);
- line = *buf + (*pline - line);
- }
- if (x) {
- *line++ = ',';
- len--;
- }
+ for (int x = 0; x < data->num; x++) {
+ if (x) {
+ buffer_addch(buf, ',');
+ }