char *def, char *value, int nid, int min, int max)
char *def, char *value, int nid, int n_min, int n_max)
static int add_attribute_object(X509_REQ *req, char *text,				char *def, char *value, int nid, int min,				int max)	{	int i;	static char buf[1024];start:	if (!batch) BIO_printf(bio_err,"%s [%s]:",text,def);	(void)BIO_flush(bio_err);	if (value != NULL)		{		strcpy(buf,value);		strcat(buf,"\n");		BIO_printf(bio_err,"%s\n",value);		}	else		{		buf[0]='\0';		if (!batch)			{			fgets(buf,1024,stdin);			}		else			{			buf[0] = '\n';			buf[1] = '\0';			}		}	if (buf[0] == '\0') return(0);	else if (buf[0] == '\n')		{		if ((def == NULL) || (def[0] == '\0'))			return(1);		strcpy(buf,def);		strcat(buf,"\n");		}	else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);	i=strlen(buf);	if (buf[i-1] != '\n')		{		BIO_printf(bio_err,"weird input :-(\n");		return(0);		}	buf[--i]='\0';#ifdef CHARSET_EBCDIC	ebcdic2ascii(buf, buf, i);#endif	if(!req_check_len(i, min, max)) goto start;	if(!X509_REQ_add1_attr_by_NID(req, nid, MBSTRING_ASC,					(unsigned char *)buf, -1)) {		BIO_printf(bio_err, "Error adding attribute\n");		ERR_print_errors(bio_err);		goto err;	}	return(1);err:	return(0);	}