newlen = t->length + 2 + 1;
str = (char *)ret->data;
/* Work out the century and prepend */
- if (t->data[0] >= '5') BUF_strlcpy(str, "19", newlen);
- else BUF_strlcpy(str, "20", newlen);
+ if (t->data[0] >= '5') strlcpy(str, "19", newlen);
+ else strlcpy(str, "20", newlen);
- BUF_strlcat(str, (char *)t->data, newlen);
+ strlcat(str, (char *)t->data, newlen);
return ret;
}
rows++;
for (i = 0; i < rows; i++) {
buf[0] = '\0'; /* start with empty string */
- BUF_strlcpy(buf, str, sizeof buf);
+ strlcpy(buf, str, sizeof buf);
(void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
- BUF_strlcat(buf, tmp, sizeof buf);
+ strlcat(buf, tmp, sizeof buf);
for (j = 0; j < dump_width; j++) {
if (((i*dump_width) + j) >= len) {
- BUF_strlcat(buf, " ", sizeof buf);
+ strlcat(buf, " ", sizeof buf);
} else {
ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
(void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
j == 7 ? '-' : ' ');
- BUF_strlcat(buf, tmp, sizeof buf);
+ strlcat(buf, tmp, sizeof buf);
}
}
- BUF_strlcat(buf, " ", sizeof buf);
+ strlcat(buf, " ", sizeof buf);
for (j = 0; j < dump_width; j++) {
if (((i*dump_width) + j) >= len)
break;
ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
(void) snprintf(tmp, sizeof tmp, "%c",
((ch >= ' ') && (ch <= '~')) ? ch : '.');
- BUF_strlcat(buf, tmp, sizeof buf);
+ strlcat(buf, tmp, sizeof buf);
}
- BUF_strlcat(buf, "\n", sizeof buf);
+ strlcat(buf, "\n", sizeof buf);
/* if this is the last call then update the ddt_dump thing so
* that we will move the selection point in the debug window
*/
b->shutdown = (int)num&BIO_CLOSE;
if (num & BIO_FP_APPEND) {
if (num & BIO_FP_READ)
- BUF_strlcpy(p, "a+", sizeof p);
- else BUF_strlcpy(p, "a", sizeof p);
+ strlcpy(p, "a+", sizeof p);
+ else strlcpy(p, "a", sizeof p);
} else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
- BUF_strlcpy(p, "r+", sizeof p);
+ strlcpy(p, "r+", sizeof p);
else if (num & BIO_FP_WRITE)
- BUF_strlcpy(p, "w", sizeof p);
+ strlcpy(p, "w", sizeof p);
else if (num & BIO_FP_READ)
- BUF_strlcpy(p, "r", sizeof p);
+ strlcpy(p, "r", sizeof p);
else {
BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
ret = 0;
CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
goto err;
}
- BUF_strlcpy(section,"default",10);
+ strlcpy(section,"default",10);
if (_CONF_new_data(conf) == 0)
{
ERR_R_MALLOC_FAILURE);
goto err;
}
- BUF_strlcpy(v->name,pname,strlen(pname)+1);
+ strlcpy(v->name,pname,strlen(pname)+1);
if (!str_copy(conf,psection,&(v->value),start)) goto err;
if (strcmp(psection,section) != 0)
DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
return(0);
}
- BUF_strlcpy(copied, filename, strlen(filename) + 1);
+ strlcpy(copied, filename, strlen(filename) + 1);
if(dso->filename)
free(dso->filename);
dso->filename = copied;
ERR_R_MALLOC_FAILURE);
return(NULL);
}
- BUF_strlcpy(result, filename, strlen(filename) + 1);
+ strlcpy(result, filename, strlen(filename) + 1);
}
return(result);
}
else
str=p;
}
- BUF_strlcat(str,a,(size_t)s+1);
+ strlcat(str,a,(size_t)s+1);
}
}
ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
{
char obj_tmp[80];
EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
- if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
+ if (!pbe_obj) strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
ERR_add_error_data(2, "TYPE=", obj_tmp);
return 0;
if (s)
{
if (buf)
- BUF_strlcpy(buf,s,buf_len);
+ strlcpy(buf,s,buf_len);
n=strlen(s);
return n;
}
*buf++ = '.';
buf_len--;
}
- BUF_strlcpy(buf,bndec,buf_len);
+ strlcpy(buf,bndec,buf_len);
if (i > buf_len)
{
buf += buf_len;
i=strlen(tbuf);
if (buf && (buf_len > 0))
{
- BUF_strlcpy(buf,tbuf,buf_len);
+ strlcpy(buf,tbuf,buf_len);
if (i > buf_len)
{
buf += buf_len;
else
str="BAD-TYPE";
- BUF_strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
- BUF_strlcat(buf,str,PEM_BUFSIZE);
- BUF_strlcat(buf,"\n",PEM_BUFSIZE);
+ strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
+ strlcat(buf,str,PEM_BUFSIZE);
+ strlcat(buf,"\n",PEM_BUFSIZE);
}
void PEM_dek_info(char *buf, const char *type, int len, char *str)
long i;
int j;
- BUF_strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
- BUF_strlcat(buf,type,PEM_BUFSIZE);
- BUF_strlcat(buf,",",PEM_BUFSIZE);
+ strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
+ strlcat(buf,type,PEM_BUFSIZE);
+ strlcat(buf,",",PEM_BUFSIZE);
j=strlen(buf);
if (j + (len * 2) + 1 > PEM_BUFSIZE)
return;
const char *RAND_file_name(char *buf, size_t size)
{
- if (BUF_strlcpy(buf,"/dev/urandom",size) >= size)
+ if (strlcpy(buf,"/dev/urandom",size) >= size)
return(NULL);
return buf;
}
len += sizeof(prompt3) - 1;
prompt = (char *)malloc(len + 1);
- BUF_strlcpy(prompt, prompt1, len + 1);
- BUF_strlcat(prompt, object_desc, len + 1);
+ strlcpy(prompt, prompt1, len + 1);
+ strlcat(prompt, object_desc, len + 1);
if (object_name) {
- BUF_strlcat(prompt, prompt2, len + 1);
- BUF_strlcat(prompt, object_name, len + 1);
+ strlcat(prompt, prompt2, len + 1);
+ strlcat(prompt, object_name, len + 1);
}
- BUF_strlcat(prompt, prompt3, len + 1);
+ strlcat(prompt, prompt3, len + 1);
}
return prompt;
}
UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER);
return -1;
}
- BUF_strlcpy(uis->result_buf, result,
+ strlcpy(uis->result_buf, result,
uis->_.string_data.result_maxsize + 1);
break;
case UIT_BOOLEAN:
ERR_R_MALLOC_FAILURE);
return NULL;
}
- BUF_strlcpy(ntmp, objtmp, nlen);
- BUF_strlcat(ntmp, " - ", nlen);
- BUF_strlcat(ntmp, vtmp->name, nlen);
+ strlcpy(ntmp, objtmp, nlen);
+ strlcat(ntmp, " - ", nlen);
+ strlcat(ntmp, vtmp->name, nlen);
free(vtmp->name);
vtmp->name = ntmp;
p++;
else
p = in;
- BUF_strlcpy(out, p, size);
+ strlcpy(out, p, size);
}
int
goto err;
}
if (suffix == NULL)
- BUF_strlcpy(buf[0], serialfile, BSIZE);
+ strlcpy(buf[0], serialfile, BSIZE);
else
(void) snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
#ifdef RL_DEBUG
}
strlcpy(buf[2], outdir, sizeof(buf[2]));
- BUF_strlcat(buf[2], "/", sizeof(buf[2]));
+ strlcat(buf[2], "/", sizeof(buf[2]));
n = (char *) &(buf[2][strlen(buf[2])]);
if (j > 0) {
BIO_printf(bio_err, "Memory allocation failure\n");
goto err;
}
- BUF_strlcpy(row[DB_file], "unknown", 8);
+ strlcpy(row[DB_file], "unknown", 8);
row[DB_type][0] = 'V';
row[DB_type][1] = '\0';
BIO_printf(bio_err, "Memory allocation failure\n");
goto err;
}
- BUF_strlcpy(row[DB_file], "unknown", 8);
+ strlcpy(row[DB_file], "unknown", 8);
row[DB_type][0] = 'V';
row[DB_type][1] = '\0';
if (!str)
return NULL;
- BUF_strlcpy(str, (char *) revtm->data, i);
+ strlcpy(str, (char *) revtm->data, i);
if (reason) {
- BUF_strlcat(str, ",", i);
- BUF_strlcat(str, reason, i);
+ strlcat(str, ",", i);
+ strlcat(str, reason, i);
}
if (other) {
- BUF_strlcat(str, ",", i);
- BUF_strlcat(str, other, i);
+ strlcat(str, ",", i);
+ strlcat(str, other, i);
}
ASN1_UTCTIME_free(revtm);
return str;
return 0;
if (**buf != '\0')
- BUF_strlcat(*buf, ", ", *size);
- BUF_strlcat(*buf, s, *size);
+ strlcat(*buf, ", ", *size);
+ strlcat(*buf, s, *size);
return 1;
}
goto export_end;
}
if (!twopass)
- BUF_strlcpy(macpass, pass, sizeof macpass);
+ strlcpy(macpass, pass, sizeof macpass);
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();
#endif
if (!twopass)
- BUF_strlcpy(macpass, pass, sizeof macpass);
+ strlcpy(macpass, pass, sizeof macpass);
if ((options & INFO) && p12->mac)
BIO_printf(bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get(p12->mac->iter) : 1);
BIO_printf(bio_err, "%s [%s]:", text, def);
(void) BIO_flush(bio_err);
if (value != NULL) {
- BUF_strlcpy(buf, value, sizeof buf);
- BUF_strlcat(buf, "\n", sizeof buf);
+ strlcpy(buf, value, sizeof buf);
+ strlcat(buf, "\n", sizeof buf);
BIO_printf(bio_err, "%s\n", value);
} else {
buf[0] = '\0';
else if (buf[0] == '\n') {
if ((def == NULL) || (def[0] == '\0'))
return (1);
- BUF_strlcpy(buf, def, sizeof buf);
- BUF_strlcat(buf, "\n", sizeof buf);
+ strlcpy(buf, def, sizeof buf);
+ strlcat(buf, "\n", sizeof buf);
} else if ((buf[0] == '.') && (buf[1] == '\n'))
return (1);
BIO_printf(bio_err, "%s [%s]:", text, def);
(void) BIO_flush(bio_err);
if (value != NULL) {
- BUF_strlcpy(buf, value, sizeof buf);
- BUF_strlcat(buf, "\n", sizeof buf);
+ strlcpy(buf, value, sizeof buf);
+ strlcat(buf, "\n", sizeof buf);
BIO_printf(bio_err, "%s\n", value);
} else {
buf[0] = '\0';
else if (buf[0] == '\n') {
if ((def == NULL) || (def[0] == '\0'))
return (1);
- BUF_strlcpy(buf, def, sizeof buf);
- BUF_strlcat(buf, "\n", sizeof buf);
+ strlcpy(buf, def, sizeof buf);
+ strlcat(buf, "\n", sizeof buf);
} else if ((buf[0] == '.') && (buf[1] == '\n'))
return (1);
perror("malloc");
return (0);
}
- BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
+ strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
h2 = GetHostByName(*host);
if (h2 == NULL) {
goto end;
}
if (serialfile == NULL) {
- BUF_strlcpy(buf, CAfile, len);
+ strlcpy(buf, CAfile, len);
for (p = buf; *p; p++)
if (*p == '.') {
*p = '\0';
break;
}
- BUF_strlcat(buf, POSTFIX, len);
+ strlcat(buf, POSTFIX, len);
} else
- BUF_strlcpy(buf, serialfile, len);
+ strlcpy(buf, serialfile, len);
serial = load_serial(buf, create, NULL);
if (serial == NULL)
newlen = t->length + 2 + 1;
str = (char *)ret->data;
/* Work out the century and prepend */
- if (t->data[0] >= '5') BUF_strlcpy(str, "19", newlen);
- else BUF_strlcpy(str, "20", newlen);
+ if (t->data[0] >= '5') strlcpy(str, "19", newlen);
+ else strlcpy(str, "20", newlen);
- BUF_strlcat(str, (char *)t->data, newlen);
+ strlcat(str, (char *)t->data, newlen);
return ret;
}
rows++;
for (i = 0; i < rows; i++) {
buf[0] = '\0'; /* start with empty string */
- BUF_strlcpy(buf, str, sizeof buf);
+ strlcpy(buf, str, sizeof buf);
(void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
- BUF_strlcat(buf, tmp, sizeof buf);
+ strlcat(buf, tmp, sizeof buf);
for (j = 0; j < dump_width; j++) {
if (((i*dump_width) + j) >= len) {
- BUF_strlcat(buf, " ", sizeof buf);
+ strlcat(buf, " ", sizeof buf);
} else {
ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
(void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
j == 7 ? '-' : ' ');
- BUF_strlcat(buf, tmp, sizeof buf);
+ strlcat(buf, tmp, sizeof buf);
}
}
- BUF_strlcat(buf, " ", sizeof buf);
+ strlcat(buf, " ", sizeof buf);
for (j = 0; j < dump_width; j++) {
if (((i*dump_width) + j) >= len)
break;
ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
(void) snprintf(tmp, sizeof tmp, "%c",
((ch >= ' ') && (ch <= '~')) ? ch : '.');
- BUF_strlcat(buf, tmp, sizeof buf);
+ strlcat(buf, tmp, sizeof buf);
}
- BUF_strlcat(buf, "\n", sizeof buf);
+ strlcat(buf, "\n", sizeof buf);
/* if this is the last call then update the ddt_dump thing so
* that we will move the selection point in the debug window
*/
b->shutdown = (int)num&BIO_CLOSE;
if (num & BIO_FP_APPEND) {
if (num & BIO_FP_READ)
- BUF_strlcpy(p, "a+", sizeof p);
- else BUF_strlcpy(p, "a", sizeof p);
+ strlcpy(p, "a+", sizeof p);
+ else strlcpy(p, "a", sizeof p);
} else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
- BUF_strlcpy(p, "r+", sizeof p);
+ strlcpy(p, "r+", sizeof p);
else if (num & BIO_FP_WRITE)
- BUF_strlcpy(p, "w", sizeof p);
+ strlcpy(p, "w", sizeof p);
else if (num & BIO_FP_READ)
- BUF_strlcpy(p, "r", sizeof p);
+ strlcpy(p, "r", sizeof p);
else {
BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
ret = 0;
CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
goto err;
}
- BUF_strlcpy(section,"default",10);
+ strlcpy(section,"default",10);
if (_CONF_new_data(conf) == 0)
{
ERR_R_MALLOC_FAILURE);
goto err;
}
- BUF_strlcpy(v->name,pname,strlen(pname)+1);
+ strlcpy(v->name,pname,strlen(pname)+1);
if (!str_copy(conf,psection,&(v->value),start)) goto err;
if (strcmp(psection,section) != 0)
DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
return(0);
}
- BUF_strlcpy(copied, filename, strlen(filename) + 1);
+ strlcpy(copied, filename, strlen(filename) + 1);
if(dso->filename)
free(dso->filename);
dso->filename = copied;
ERR_R_MALLOC_FAILURE);
return(NULL);
}
- BUF_strlcpy(result, filename, strlen(filename) + 1);
+ strlcpy(result, filename, strlen(filename) + 1);
}
return(result);
}
else
str=p;
}
- BUF_strlcat(str,a,(size_t)s+1);
+ strlcat(str,a,(size_t)s+1);
}
}
ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
{
char obj_tmp[80];
EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
- if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
+ if (!pbe_obj) strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
ERR_add_error_data(2, "TYPE=", obj_tmp);
return 0;
if (s)
{
if (buf)
- BUF_strlcpy(buf,s,buf_len);
+ strlcpy(buf,s,buf_len);
n=strlen(s);
return n;
}
*buf++ = '.';
buf_len--;
}
- BUF_strlcpy(buf,bndec,buf_len);
+ strlcpy(buf,bndec,buf_len);
if (i > buf_len)
{
buf += buf_len;
i=strlen(tbuf);
if (buf && (buf_len > 0))
{
- BUF_strlcpy(buf,tbuf,buf_len);
+ strlcpy(buf,tbuf,buf_len);
if (i > buf_len)
{
buf += buf_len;
else
str="BAD-TYPE";
- BUF_strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
- BUF_strlcat(buf,str,PEM_BUFSIZE);
- BUF_strlcat(buf,"\n",PEM_BUFSIZE);
+ strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
+ strlcat(buf,str,PEM_BUFSIZE);
+ strlcat(buf,"\n",PEM_BUFSIZE);
}
void PEM_dek_info(char *buf, const char *type, int len, char *str)
long i;
int j;
- BUF_strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
- BUF_strlcat(buf,type,PEM_BUFSIZE);
- BUF_strlcat(buf,",",PEM_BUFSIZE);
+ strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
+ strlcat(buf,type,PEM_BUFSIZE);
+ strlcat(buf,",",PEM_BUFSIZE);
j=strlen(buf);
if (j + (len * 2) + 1 > PEM_BUFSIZE)
return;
const char *RAND_file_name(char *buf, size_t size)
{
- if (BUF_strlcpy(buf,"/dev/urandom",size) >= size)
+ if (strlcpy(buf,"/dev/urandom",size) >= size)
return(NULL);
return buf;
}
len += sizeof(prompt3) - 1;
prompt = (char *)malloc(len + 1);
- BUF_strlcpy(prompt, prompt1, len + 1);
- BUF_strlcat(prompt, object_desc, len + 1);
+ strlcpy(prompt, prompt1, len + 1);
+ strlcat(prompt, object_desc, len + 1);
if (object_name) {
- BUF_strlcat(prompt, prompt2, len + 1);
- BUF_strlcat(prompt, object_name, len + 1);
+ strlcat(prompt, prompt2, len + 1);
+ strlcat(prompt, object_name, len + 1);
}
- BUF_strlcat(prompt, prompt3, len + 1);
+ strlcat(prompt, prompt3, len + 1);
}
return prompt;
}
UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER);
return -1;
}
- BUF_strlcpy(uis->result_buf, result,
+ strlcpy(uis->result_buf, result,
uis->_.string_data.result_maxsize + 1);
break;
case UIT_BOOLEAN:
ERR_R_MALLOC_FAILURE);
return NULL;
}
- BUF_strlcpy(ntmp, objtmp, nlen);
- BUF_strlcat(ntmp, " - ", nlen);
- BUF_strlcat(ntmp, vtmp->name, nlen);
+ strlcpy(ntmp, objtmp, nlen);
+ strlcat(ntmp, " - ", nlen);
+ strlcat(ntmp, vtmp->name, nlen);
free(vtmp->name);
vtmp->name = ntmp;