strncpy(buf, arg, sizeof(buf)); buf[sizeof(buf) - 1] = '\0';
safe_strncpy(buf, arg, sizeof(buf));
int aftrans_opt(const char *arg){    struct aftrans_t *paft;    char *tmp1, *tmp2;    char buf[256];    strncpy(buf, arg, sizeof(buf));    buf[sizeof(buf) - 1] = '\0';    tmp1 = buf;    while (tmp1) {	tmp2 = index(tmp1, ',');	if (tmp2)	    *(tmp2++) = '\0';	paft = aftrans;	for (paft = aftrans; paft->alias; paft++) {	    if (strcmp(tmp1, paft->alias))		continue;	    if (strlen(paft->name) + strlen(afname) + 1 >= sizeof(afname)) {		fprintf(stderr, _("Too much address family arguments.\n"));		return (0);	    }	    if (paft->flag)		(*paft->flag)++;	    if (afname[0])		strcat(afname, ",");	    strcat(afname, paft->name);	    break;	}	if (!paft->alias) {	    fprintf(stderr, _("Unknown address family `%s'.\n"), tmp1);	    return (1);	}	tmp1 = tmp2;    }    return (0);}