strncpy(buf, afname, sizeof(buf)); buf[sizeof(buf) - 1] = '\0';
safe_strncpy(buf, afname, sizeof(buf));
int route_info(const char *afname, int options){    struct aftype *ap;    char *tmp1, *tmp2;    int found = E_NOTFOUND, rc;    char buf[256];    strncpy(buf, afname, sizeof(buf));    buf[sizeof(buf) - 1] = '\0';    tmp1 = buf;    while (tmp1) {	ap = NULL;	if ((tmp2 = index(tmp1, ',')))	    *tmp2++ = '\0';	if (!tmp1[0]) {	    tmp1 = tmp2;	    continue;	}	ap = get_aftype(tmp1);	if (!ap) {	    fprintf(stderr, _("Address family `%s' not supported.\n"), tmp1);	    return (E_OPTERR);	}	tmp1 = tmp2;	if (!ap->rprint) {	    fprintf(stderr, _("No routing for address family `%s'.\n"), ap->name);	    return (E_OPTERR);	}	found = 0;	if ((rc = ap->rprint(options)))	    return (rc);    }    return (found);}