where the return value is ignored changing to (void) snprintf.
ok deraadt@
s->data=(unsigned char *)p;
}
- BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
+ (void) snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
s->length=strlen(p);
s->type=V_ASN1_GENERALIZEDTIME;
if((minsize > 0) && (nchar < minsize)) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT);
- BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
+ (void) snprintf(strbuf, sizeof strbuf, "%ld", minsize);
ERR_add_error_data(2, "minsize=", strbuf);
return -1;
}
if((maxsize > 0) && (nchar > maxsize)) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG);
- BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
+ (void) snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
ERR_add_error_data(2, "maxsize=", strbuf);
return -1;
}
if(c > 0xffffffffL)
return -1;
if(c > 0xffff) {
- BIO_snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
+ (void) snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
if(!io_ch(arg, tmphex, 10)) return -1;
return 10;
}
if(c > 0xff) {
- BIO_snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
+ (void) snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
if(!io_ch(arg, tmphex, 6)) return -1;
return 6;
}
return 2;
}
if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
- BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
+ (void) snprintf(tmphex, 11, "\\%02X", chtmp);
if(!io_ch(arg, tmphex, 3)) return -1;
return 3;
}
s->data=(unsigned char *)p;
}
- BIO_snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
+ (void) snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
s->length=strlen(p);
s->type=V_ASN1_UTCTIME;
{
char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1];
- BIO_snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address);
- BIO_snprintf(buf2,sizeof buf2,"%d",offset);
+ (void) snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address);
+ (void) snprintf(buf2,sizeof buf2,"%d",offset);
ERR_add_error_data(4,"address=",buf1," offset=",buf2);
}
p=str;
if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
- BIO_snprintf(str,sizeof str,"priv [ %d ] ",tag);
+ (void) snprintf(str,sizeof str,"priv [ %d ] ",tag);
else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
- BIO_snprintf(str,sizeof str,"cont [ %d ]",tag);
+ (void) snprintf(str,sizeof str,"cont [ %d ]",tag);
else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
- BIO_snprintf(str,sizeof str,"appl [ %d ]",tag);
+ (void) snprintf(str,sizeof str,"appl [ %d ]",tag);
else if (tag > 30)
- BIO_snprintf(str,sizeof str,"<ASN1 %d>",tag);
+ (void) snprintf(str,sizeof str,"<ASN1 %d>",tag);
else
p = ASN1_tag2str(tag);
{
buf[0]='\0'; /* start with empty string */
BUF_strlcpy(buf,str,sizeof buf);
- BIO_snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
+ (void) snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
BUF_strlcat(buf,tmp,sizeof buf);
for(j=0;j<dump_width;j++)
{
else
{
ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
- BIO_snprintf(tmp,sizeof tmp,"%02x%c",ch,
+ (void) snprintf(tmp,sizeof tmp,"%02x%c",ch,
j==7?'-':' ');
BUF_strlcat(buf,tmp,sizeof buf);
}
break;
ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
#ifndef CHARSET_EBCDIC
- BIO_snprintf(tmp,sizeof tmp,"%c",
+ (void) snprintf(tmp,sizeof tmp,"%c",
((ch>=' ')&&(ch<='~'))?ch:'.');
#else
- BIO_snprintf(tmp,sizeof tmp,"%c",
+ (void) snprintf(tmp,sizeof tmp,"%c",
((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
? os_toebcdic[ch]
: '.');
#ifdef TRUNCATE
if (trc > 0)
{
- BIO_snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str,
+ (void) snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str,
len+trc);
ret+=cb((void *)buf,strlen(buf),u);
}
goto end;
}
*addr = p;
- BIO_snprintf(*addr,nl,"%s:%s",h,s);
+ (void) snprintf(*addr,nl,"%s:%s",h,s);
goto end;
} while(0);
#endif
}
*addr=p;
}
- BIO_snprintf(*addr,24,"%d.%d.%d.%d:%d",
+ (void) snprintf(*addr,24,"%d.%d.%d.%d:%d",
(unsigned char)(l>>24L)&0xff,
(unsigned char)(l>>16L)&0xff,
(unsigned char)(l>> 8L)&0xff,
if (BIO_CB_RETURN & cmd)
r=ret;
- BIO_snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio);
+ (void) snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio);
p= &(buf[14]);
p_maxlen = sizeof buf - 14;
switch (cmd)
{
case BIO_CB_FREE:
- BIO_snprintf(p,p_maxlen,"Free - %s\n",bio->method->name);
+ (void) snprintf(p,p_maxlen,"Free - %s\n",bio->method->name);
break;
case BIO_CB_READ:
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
- BIO_snprintf(p,p_maxlen,"read(%d,%lu) - %s fd=%d\n",
+ (void) snprintf(p,p_maxlen,"read(%d,%lu) - %s fd=%d\n",
bio->num,(unsigned long)argi,
bio->method->name,bio->num);
else
- BIO_snprintf(p,p_maxlen,"read(%d,%lu) - %s\n",
+ (void) snprintf(p,p_maxlen,"read(%d,%lu) - %s\n",
bio->num,(unsigned long)argi,
bio->method->name);
break;
case BIO_CB_WRITE:
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
- BIO_snprintf(p,p_maxlen,"write(%d,%lu) - %s fd=%d\n",
+ (void) snprintf(p,p_maxlen,"write(%d,%lu) - %s fd=%d\n",
bio->num,(unsigned long)argi,
bio->method->name,bio->num);
else
- BIO_snprintf(p,p_maxlen,"write(%d,%lu) - %s\n",
+ (void) snprintf(p,p_maxlen,"write(%d,%lu) - %s\n",
bio->num,(unsigned long)argi,
bio->method->name);
break;
case BIO_CB_PUTS:
- BIO_snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name);
+ (void) snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name);
break;
case BIO_CB_GETS:
- BIO_snprintf(p,p_maxlen,"gets(%lu) - %s\n",(unsigned long)argi,bio->method->name);
+ (void) snprintf(p,p_maxlen,"gets(%lu) - %s\n",(unsigned long)argi,bio->method->name);
break;
case BIO_CB_CTRL:
- BIO_snprintf(p,p_maxlen,"ctrl(%lu) - %s\n",(unsigned long)argi,bio->method->name);
+ (void) snprintf(p,p_maxlen,"ctrl(%lu) - %s\n",(unsigned long)argi,bio->method->name);
break;
case BIO_CB_RETURN|BIO_CB_READ:
- BIO_snprintf(p,p_maxlen,"read return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"read return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_WRITE:
- BIO_snprintf(p,p_maxlen,"write return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"write return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_GETS:
- BIO_snprintf(p,p_maxlen,"gets return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"gets return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_PUTS:
- BIO_snprintf(p,p_maxlen,"puts return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"puts return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_CTRL:
- BIO_snprintf(p,p_maxlen,"ctrl return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"ctrl return %ld\n",ret);
break;
default:
- BIO_snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd);
+ (void) snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd);
break;
}
char buf[16];
unsigned char *p = ptr;
- BIO_snprintf(buf,sizeof buf,"%d.%d.%d.%d",
+ (void) snprintf(buf,sizeof buf,"%d.%d.%d.%d",
p[0],p[1],p[2],p[3]);
if (data->param_hostname != NULL)
OPENSSL_free(data->param_hostname);
{
char buf[DECIMAL_SIZE(int)+1];
- BIO_snprintf(buf,sizeof buf,"%d",*(int *)ptr);
+ (void) snprintf(buf,sizeof buf,"%d",*(int *)ptr);
if (data->param_port != NULL)
OPENSSL_free(data->param_port);
data->param_port=BUF_strdup(buf);
/* We now have a series of blocks, BN_DEC_NUM chars
* in length, where the last one needs truncation.
* The blocks need to be reversed in order. */
- BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
+ (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
while (*p) p++;
while (lp != bn_data)
{
lp--;
- BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
+ (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
while (*p) p++;
}
}
{
init++;
#ifdef BN_LLONG
- BIO_snprintf(data,sizeof data,"bn(%d,%d)",
+ (void) snprintf(data,sizeof data,"bn(%d,%d)",
(int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
#else
- BIO_snprintf(data,sizeof data,"bn(%d,%d)",
+ (void) snprintf(data,sizeof data,"bn(%d,%d)",
(int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
#endif
}
if (buff != NULL) BUF_MEM_free(buff);
if (section != NULL) OPENSSL_free(section);
if (line != NULL) *line=eline;
- BIO_snprintf(btmp,sizeof btmp,"%ld",eline);
+ (void) snprintf(btmp,sizeof btmp,"%ld",eline);
ERR_add_error_data(2,"line ",btmp);
if ((h != conf->data) && (conf->data != NULL))
{
{
char rcode[DECIMAL_SIZE(ret)+1];
CONFerr(CONF_F_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR);
- BIO_snprintf(rcode, sizeof rcode, "%-8d", ret);
+ (void) snprintf(rcode, sizeof rcode, "%-8d", ret);
ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
}
}
#ifdef DATE
static char buf[sizeof(DATE) + 11];
- BIO_snprintf(buf, sizeof buf, "built on: %s", DATE);
+ (void) snprintf(buf, sizeof buf, "built on: %s", DATE);
return (buf);
#else
return("built on: date not available");
#ifdef CFLAGS
static char buf[sizeof(CFLAGS) + 11];
- BIO_snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
+ (void) snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
return (buf);
#else
return("compiler: information not available");
#ifdef PLATFORM
static char buf[sizeof(PLATFORM) + 11];
- BIO_snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
+ (void) snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
return (buf);
#else
return("platform: information not available");
size="int";
else
size="long";
- BIO_snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
+ (void) snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
size);
init=0;
}
#endif
/* Generate a nice engine name with available features */
- BIO_snprintf(padlock_name, sizeof(padlock_name),
+ (void) snprintf(padlock_name, sizeof(padlock_name),
"VIA PadLock (%s, %s)",
padlock_use_rng ? "RNG" : "no-RNG",
padlock_use_ace ? "ACE" : "no-ACE");
rs=ERR_reason_error_string(e);
if (ls == NULL)
- BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
+ (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
if (fs == NULL)
- BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
+ (void) snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
if (rs == NULL)
- BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
+ (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
- BIO_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
+ (void) snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
fs?fs:fsbuf, rs?rs:rsbuf);
if (strlen(buf) == len-1)
{
while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0)
{
ERR_error_string_n(l, buf, sizeof buf);
- BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
+ (void) snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
file, line, (flags & ERR_TXT_STRING) ? data : "");
if (cb(buf2, strlen(buf2), u) <= 0)
break; /* abort outputting the error report */
if (options & V_CRYPTO_MDEBUG_TIME) {
lcl = localtime(&m->time);
- BIO_snprintf(bufp, BUF_REMAIN, "[%02d:%02d:%02d] ",
+ (void) snprintf(bufp, BUF_REMAIN, "[%02d:%02d:%02d] ",
lcl->tm_hour, lcl->tm_min, lcl->tm_sec);
bufp += strlen(bufp);
}
- BIO_snprintf(bufp, BUF_REMAIN, "%5lu file=%s, line=%d, ",
+ (void) snprintf(bufp, BUF_REMAIN, "%5lu file=%s, line=%d, ",
m->order, m->file, m->line);
bufp += strlen(bufp);
if (options & V_CRYPTO_MDEBUG_THREAD) {
- BIO_snprintf(bufp, BUF_REMAIN, "thread=%lu, ",
+ (void) snprintf(bufp, BUF_REMAIN, "thread=%lu, ",
CRYPTO_THREADID_hash(&m->threadid));
bufp += strlen(bufp);
}
- BIO_snprintf(bufp, BUF_REMAIN, "number=%d, address=%08lX\n",
+ (void) snprintf(bufp, BUF_REMAIN, "number=%d, address=%08lX\n",
m->num,(unsigned long)m->addr);
bufp += strlen(bufp);
ami_cnt++;
memset(buf, '>', ami_cnt);
- BIO_snprintf(buf + ami_cnt, sizeof buf - ami_cnt,
+ (void) snprintf(buf + ami_cnt, sizeof buf - ami_cnt,
" thread=%lu, file=%s, line=%d, info=\"",
CRYPTO_THREADID_hash(&amip->threadid), amip->file,
amip->line);
sizeof buf - buf_len);
buf_len = strlen(buf);
}
- BIO_snprintf(buf + buf_len, sizeof buf - buf_len, "\"\n");
+ (void) snprintf(buf + buf_len, sizeof buf - buf_len, "\"\n");
BIO_puts(l->bio, buf);
}
else
{
- BIO_snprintf(tbuf,sizeof tbuf,".%lu",l);
+ (void) snprintf(tbuf,sizeof tbuf,".%lu",l);
i=strlen(tbuf);
if (buf && (buf_len > 0))
{
(char *)kstr, klen,
cb, u);
- BIO_snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
+ (void) snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
return PEM_ASN1_write_bio((i2d_of_void *)i2d_PrivateKey,
pem_str,bp,x,enc,kstr,klen,cb,u);
}
if (!x->ameth || !x->ameth->param_encode)
return 0;
- BIO_snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
+ (void) snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
return PEM_ASN1_write_bio(
(i2d_of_void *)x->ameth->param_encode,
pem_str,bp,x,NULL,NULL,0,0,NULL);
char number1[DECIMAL_SIZE(uis->_.string_data.result_minsize)+1];
char number2[DECIMAL_SIZE(uis->_.string_data.result_maxsize)+1];
- BIO_snprintf(number1, sizeof(number1), "%d",
+ (void) snprintf(number1, sizeof(number1), "%d",
uis->_.string_data.result_minsize);
- BIO_snprintf(number2, sizeof(number2), "%d",
+ (void) snprintf(number2, sizeof(number2), "%d",
uis->_.string_data.result_maxsize);
if (l < uis->_.string_data.result_minsize)
{
/* This is special. When c == '\0', no
directory separator should be added. */
- BIO_snprintf(b->data,b->max,
+ (void) snprintf(b->data,b->max,
"%s%08lx.%s%d",ent->dir,h,
postfix,k);
}
else
{
- BIO_snprintf(b->data,b->max,
+ (void) snprintf(b->data,b->max,
"%s%c%08lx.%s%d",ent->dir,c,h,
postfix,k);
}
return("CRL path validation error");
default:
- BIO_snprintf(buf,sizeof buf,"error number %ld",n);
+ (void) snprintf(buf,sizeof buf,"error number %ld",n);
return(buf);
}
}
case GEN_IPADD:
p = gen->d.ip->data;
if(gen->d.ip->length == 4)
- BIO_snprintf(oline, sizeof oline,
+ (void) snprintf(oline, sizeof oline,
"%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
else if(gen->d.ip->length == 16)
{
oline[0] = 0;
for (i = 0; i < 8; i++)
{
- BIO_snprintf(htmp, sizeof htmp,
+ (void) snprintf(htmp, sizeof htmp,
"%X", p[0] << 8 | p[1]);
p += 2;
strlcat(oline, htmp, sizeof(oline));
s->rwstate = SSL_NOTHING;
s->s3->fatal_alert = alert_descr;
SSLerr(SSL_F_SSL3_READ_BYTES, SSL_AD_REASON_OFFSET + alert_descr);
- BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr);
+ (void) snprintf(tmp, sizeof tmp, "%d", alert_descr);
ERR_add_error_data(2, "SSL alert number ", tmp);
s->shutdown|=SSL_RECEIVED_SHUTDOWN;
SSL_CTX_remove_session(s->ctx, s->session);
{
if (n >= &(buf[2][sizeof(buf[2])]))
break;
- BIO_snprintf(n,
+ (void) snprintf(n,
&buf[2][0] + sizeof(buf[2]) - n,
"%02X",(unsigned char)*(p++));
n+=2;
{
char buf[200];
- BIO_snprintf(buf,sizeof buf,"enter %s %s password:",
+ (void) snprintf(buf,sizeof buf,"enter %s %s password:",
OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
(enc)?"encryption":"decryption");
strbuf[0]='\0';
def="";
}
- BIO_snprintf(buf,sizeof buf,"%s_value",v->name);
+ (void) snprintf(buf,sizeof buf,"%s_value",v->name);
if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
{
ERR_clear_error();
value=NULL;
}
- BIO_snprintf(buf,sizeof buf,"%s_min",v->name);
+ (void) snprintf(buf,sizeof buf,"%s_min",v->name);
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min))
{
ERR_clear_error();
n_min = -1;
}
- BIO_snprintf(buf,sizeof buf,"%s_max",v->name);
+ (void) snprintf(buf,sizeof buf,"%s_max",v->name);
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max))
{
ERR_clear_error();
}
- BIO_snprintf(buf,sizeof buf,"%s_value",type);
+ (void) snprintf(buf,sizeof buf,"%s_value",type);
if ((value=NCONF_get_string(req_conf,attr_sect,buf))
== NULL)
{
if (s_www_path != NULL)
{
- BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
+ (void) snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
SSL_write(scon,buf,strlen(buf));
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
bytes_read+=i;
if (s_www_path != NULL)
{
- BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
+ (void) snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
SSL_write(scon,buf,strlen(buf));
while (SSL_read(scon,buf,sizeof(buf)) > 0)
;
if (s_www_path)
{
- BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
+ (void) snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
SSL_write(scon,buf,strlen(buf));
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
bytes_read+=i;
s->data=(unsigned char *)p;
}
- BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
+ (void) snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
s->length=strlen(p);
s->type=V_ASN1_GENERALIZEDTIME;
if((minsize > 0) && (nchar < minsize)) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT);
- BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
+ (void) snprintf(strbuf, sizeof strbuf, "%ld", minsize);
ERR_add_error_data(2, "minsize=", strbuf);
return -1;
}
if((maxsize > 0) && (nchar > maxsize)) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG);
- BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
+ (void) snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
ERR_add_error_data(2, "maxsize=", strbuf);
return -1;
}
if(c > 0xffffffffL)
return -1;
if(c > 0xffff) {
- BIO_snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
+ (void) snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
if(!io_ch(arg, tmphex, 10)) return -1;
return 10;
}
if(c > 0xff) {
- BIO_snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
+ (void) snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
if(!io_ch(arg, tmphex, 6)) return -1;
return 6;
}
return 2;
}
if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
- BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
+ (void) snprintf(tmphex, 11, "\\%02X", chtmp);
if(!io_ch(arg, tmphex, 3)) return -1;
return 3;
}
s->data=(unsigned char *)p;
}
- BIO_snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
+ (void) snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
s->length=strlen(p);
s->type=V_ASN1_UTCTIME;
{
char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1];
- BIO_snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address);
- BIO_snprintf(buf2,sizeof buf2,"%d",offset);
+ (void) snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address);
+ (void) snprintf(buf2,sizeof buf2,"%d",offset);
ERR_add_error_data(4,"address=",buf1," offset=",buf2);
}
p=str;
if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
- BIO_snprintf(str,sizeof str,"priv [ %d ] ",tag);
+ (void) snprintf(str,sizeof str,"priv [ %d ] ",tag);
else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
- BIO_snprintf(str,sizeof str,"cont [ %d ]",tag);
+ (void) snprintf(str,sizeof str,"cont [ %d ]",tag);
else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
- BIO_snprintf(str,sizeof str,"appl [ %d ]",tag);
+ (void) snprintf(str,sizeof str,"appl [ %d ]",tag);
else if (tag > 30)
- BIO_snprintf(str,sizeof str,"<ASN1 %d>",tag);
+ (void) snprintf(str,sizeof str,"<ASN1 %d>",tag);
else
p = ASN1_tag2str(tag);
{
buf[0]='\0'; /* start with empty string */
BUF_strlcpy(buf,str,sizeof buf);
- BIO_snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
+ (void) snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
BUF_strlcat(buf,tmp,sizeof buf);
for(j=0;j<dump_width;j++)
{
else
{
ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
- BIO_snprintf(tmp,sizeof tmp,"%02x%c",ch,
+ (void) snprintf(tmp,sizeof tmp,"%02x%c",ch,
j==7?'-':' ');
BUF_strlcat(buf,tmp,sizeof buf);
}
break;
ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
#ifndef CHARSET_EBCDIC
- BIO_snprintf(tmp,sizeof tmp,"%c",
+ (void) snprintf(tmp,sizeof tmp,"%c",
((ch>=' ')&&(ch<='~'))?ch:'.');
#else
- BIO_snprintf(tmp,sizeof tmp,"%c",
+ (void) snprintf(tmp,sizeof tmp,"%c",
((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
? os_toebcdic[ch]
: '.');
#ifdef TRUNCATE
if (trc > 0)
{
- BIO_snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str,
+ (void) snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str,
len+trc);
ret+=cb((void *)buf,strlen(buf),u);
}
goto end;
}
*addr = p;
- BIO_snprintf(*addr,nl,"%s:%s",h,s);
+ (void) snprintf(*addr,nl,"%s:%s",h,s);
goto end;
} while(0);
#endif
}
*addr=p;
}
- BIO_snprintf(*addr,24,"%d.%d.%d.%d:%d",
+ (void) snprintf(*addr,24,"%d.%d.%d.%d:%d",
(unsigned char)(l>>24L)&0xff,
(unsigned char)(l>>16L)&0xff,
(unsigned char)(l>> 8L)&0xff,
if (BIO_CB_RETURN & cmd)
r=ret;
- BIO_snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio);
+ (void) snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio);
p= &(buf[14]);
p_maxlen = sizeof buf - 14;
switch (cmd)
{
case BIO_CB_FREE:
- BIO_snprintf(p,p_maxlen,"Free - %s\n",bio->method->name);
+ (void) snprintf(p,p_maxlen,"Free - %s\n",bio->method->name);
break;
case BIO_CB_READ:
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
- BIO_snprintf(p,p_maxlen,"read(%d,%lu) - %s fd=%d\n",
+ (void) snprintf(p,p_maxlen,"read(%d,%lu) - %s fd=%d\n",
bio->num,(unsigned long)argi,
bio->method->name,bio->num);
else
- BIO_snprintf(p,p_maxlen,"read(%d,%lu) - %s\n",
+ (void) snprintf(p,p_maxlen,"read(%d,%lu) - %s\n",
bio->num,(unsigned long)argi,
bio->method->name);
break;
case BIO_CB_WRITE:
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
- BIO_snprintf(p,p_maxlen,"write(%d,%lu) - %s fd=%d\n",
+ (void) snprintf(p,p_maxlen,"write(%d,%lu) - %s fd=%d\n",
bio->num,(unsigned long)argi,
bio->method->name,bio->num);
else
- BIO_snprintf(p,p_maxlen,"write(%d,%lu) - %s\n",
+ (void) snprintf(p,p_maxlen,"write(%d,%lu) - %s\n",
bio->num,(unsigned long)argi,
bio->method->name);
break;
case BIO_CB_PUTS:
- BIO_snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name);
+ (void) snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name);
break;
case BIO_CB_GETS:
- BIO_snprintf(p,p_maxlen,"gets(%lu) - %s\n",(unsigned long)argi,bio->method->name);
+ (void) snprintf(p,p_maxlen,"gets(%lu) - %s\n",(unsigned long)argi,bio->method->name);
break;
case BIO_CB_CTRL:
- BIO_snprintf(p,p_maxlen,"ctrl(%lu) - %s\n",(unsigned long)argi,bio->method->name);
+ (void) snprintf(p,p_maxlen,"ctrl(%lu) - %s\n",(unsigned long)argi,bio->method->name);
break;
case BIO_CB_RETURN|BIO_CB_READ:
- BIO_snprintf(p,p_maxlen,"read return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"read return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_WRITE:
- BIO_snprintf(p,p_maxlen,"write return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"write return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_GETS:
- BIO_snprintf(p,p_maxlen,"gets return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"gets return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_PUTS:
- BIO_snprintf(p,p_maxlen,"puts return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"puts return %ld\n",ret);
break;
case BIO_CB_RETURN|BIO_CB_CTRL:
- BIO_snprintf(p,p_maxlen,"ctrl return %ld\n",ret);
+ (void) snprintf(p,p_maxlen,"ctrl return %ld\n",ret);
break;
default:
- BIO_snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd);
+ (void) snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd);
break;
}
char buf[16];
unsigned char *p = ptr;
- BIO_snprintf(buf,sizeof buf,"%d.%d.%d.%d",
+ (void) snprintf(buf,sizeof buf,"%d.%d.%d.%d",
p[0],p[1],p[2],p[3]);
if (data->param_hostname != NULL)
OPENSSL_free(data->param_hostname);
{
char buf[DECIMAL_SIZE(int)+1];
- BIO_snprintf(buf,sizeof buf,"%d",*(int *)ptr);
+ (void) snprintf(buf,sizeof buf,"%d",*(int *)ptr);
if (data->param_port != NULL)
OPENSSL_free(data->param_port);
data->param_port=BUF_strdup(buf);
/* We now have a series of blocks, BN_DEC_NUM chars
* in length, where the last one needs truncation.
* The blocks need to be reversed in order. */
- BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
+ (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
while (*p) p++;
while (lp != bn_data)
{
lp--;
- BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
+ (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
while (*p) p++;
}
}
{
init++;
#ifdef BN_LLONG
- BIO_snprintf(data,sizeof data,"bn(%d,%d)",
+ (void) snprintf(data,sizeof data,"bn(%d,%d)",
(int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
#else
- BIO_snprintf(data,sizeof data,"bn(%d,%d)",
+ (void) snprintf(data,sizeof data,"bn(%d,%d)",
(int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
#endif
}
if (buff != NULL) BUF_MEM_free(buff);
if (section != NULL) OPENSSL_free(section);
if (line != NULL) *line=eline;
- BIO_snprintf(btmp,sizeof btmp,"%ld",eline);
+ (void) snprintf(btmp,sizeof btmp,"%ld",eline);
ERR_add_error_data(2,"line ",btmp);
if ((h != conf->data) && (conf->data != NULL))
{
{
char rcode[DECIMAL_SIZE(ret)+1];
CONFerr(CONF_F_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR);
- BIO_snprintf(rcode, sizeof rcode, "%-8d", ret);
+ (void) snprintf(rcode, sizeof rcode, "%-8d", ret);
ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
}
}
#ifdef DATE
static char buf[sizeof(DATE) + 11];
- BIO_snprintf(buf, sizeof buf, "built on: %s", DATE);
+ (void) snprintf(buf, sizeof buf, "built on: %s", DATE);
return (buf);
#else
return("built on: date not available");
#ifdef CFLAGS
static char buf[sizeof(CFLAGS) + 11];
- BIO_snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
+ (void) snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
return (buf);
#else
return("compiler: information not available");
#ifdef PLATFORM
static char buf[sizeof(PLATFORM) + 11];
- BIO_snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
+ (void) snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
return (buf);
#else
return("platform: information not available");
size="int";
else
size="long";
- BIO_snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
+ (void) snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
size);
init=0;
}
#endif
/* Generate a nice engine name with available features */
- BIO_snprintf(padlock_name, sizeof(padlock_name),
+ (void) snprintf(padlock_name, sizeof(padlock_name),
"VIA PadLock (%s, %s)",
padlock_use_rng ? "RNG" : "no-RNG",
padlock_use_ace ? "ACE" : "no-ACE");
rs=ERR_reason_error_string(e);
if (ls == NULL)
- BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
+ (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
if (fs == NULL)
- BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
+ (void) snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
if (rs == NULL)
- BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
+ (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
- BIO_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
+ (void) snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
fs?fs:fsbuf, rs?rs:rsbuf);
if (strlen(buf) == len-1)
{
while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0)
{
ERR_error_string_n(l, buf, sizeof buf);
- BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
+ (void) snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
file, line, (flags & ERR_TXT_STRING) ? data : "");
if (cb(buf2, strlen(buf2), u) <= 0)
break; /* abort outputting the error report */
if (options & V_CRYPTO_MDEBUG_TIME) {
lcl = localtime(&m->time);
- BIO_snprintf(bufp, BUF_REMAIN, "[%02d:%02d:%02d] ",
+ (void) snprintf(bufp, BUF_REMAIN, "[%02d:%02d:%02d] ",
lcl->tm_hour, lcl->tm_min, lcl->tm_sec);
bufp += strlen(bufp);
}
- BIO_snprintf(bufp, BUF_REMAIN, "%5lu file=%s, line=%d, ",
+ (void) snprintf(bufp, BUF_REMAIN, "%5lu file=%s, line=%d, ",
m->order, m->file, m->line);
bufp += strlen(bufp);
if (options & V_CRYPTO_MDEBUG_THREAD) {
- BIO_snprintf(bufp, BUF_REMAIN, "thread=%lu, ",
+ (void) snprintf(bufp, BUF_REMAIN, "thread=%lu, ",
CRYPTO_THREADID_hash(&m->threadid));
bufp += strlen(bufp);
}
- BIO_snprintf(bufp, BUF_REMAIN, "number=%d, address=%08lX\n",
+ (void) snprintf(bufp, BUF_REMAIN, "number=%d, address=%08lX\n",
m->num,(unsigned long)m->addr);
bufp += strlen(bufp);
ami_cnt++;
memset(buf, '>', ami_cnt);
- BIO_snprintf(buf + ami_cnt, sizeof buf - ami_cnt,
+ (void) snprintf(buf + ami_cnt, sizeof buf - ami_cnt,
" thread=%lu, file=%s, line=%d, info=\"",
CRYPTO_THREADID_hash(&amip->threadid), amip->file,
amip->line);
sizeof buf - buf_len);
buf_len = strlen(buf);
}
- BIO_snprintf(buf + buf_len, sizeof buf - buf_len, "\"\n");
+ (void) snprintf(buf + buf_len, sizeof buf - buf_len, "\"\n");
BIO_puts(l->bio, buf);
}
else
{
- BIO_snprintf(tbuf,sizeof tbuf,".%lu",l);
+ (void) snprintf(tbuf,sizeof tbuf,".%lu",l);
i=strlen(tbuf);
if (buf && (buf_len > 0))
{
(char *)kstr, klen,
cb, u);
- BIO_snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
+ (void) snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
return PEM_ASN1_write_bio((i2d_of_void *)i2d_PrivateKey,
pem_str,bp,x,enc,kstr,klen,cb,u);
}
if (!x->ameth || !x->ameth->param_encode)
return 0;
- BIO_snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
+ (void) snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
return PEM_ASN1_write_bio(
(i2d_of_void *)x->ameth->param_encode,
pem_str,bp,x,NULL,NULL,0,0,NULL);
char number1[DECIMAL_SIZE(uis->_.string_data.result_minsize)+1];
char number2[DECIMAL_SIZE(uis->_.string_data.result_maxsize)+1];
- BIO_snprintf(number1, sizeof(number1), "%d",
+ (void) snprintf(number1, sizeof(number1), "%d",
uis->_.string_data.result_minsize);
- BIO_snprintf(number2, sizeof(number2), "%d",
+ (void) snprintf(number2, sizeof(number2), "%d",
uis->_.string_data.result_maxsize);
if (l < uis->_.string_data.result_minsize)
{
/* This is special. When c == '\0', no
directory separator should be added. */
- BIO_snprintf(b->data,b->max,
+ (void) snprintf(b->data,b->max,
"%s%08lx.%s%d",ent->dir,h,
postfix,k);
}
else
{
- BIO_snprintf(b->data,b->max,
+ (void) snprintf(b->data,b->max,
"%s%c%08lx.%s%d",ent->dir,c,h,
postfix,k);
}
return("CRL path validation error");
default:
- BIO_snprintf(buf,sizeof buf,"error number %ld",n);
+ (void) snprintf(buf,sizeof buf,"error number %ld",n);
return(buf);
}
}
case GEN_IPADD:
p = gen->d.ip->data;
if(gen->d.ip->length == 4)
- BIO_snprintf(oline, sizeof oline,
+ (void) snprintf(oline, sizeof oline,
"%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
else if(gen->d.ip->length == 16)
{
oline[0] = 0;
for (i = 0; i < 8; i++)
{
- BIO_snprintf(htmp, sizeof htmp,
+ (void) snprintf(htmp, sizeof htmp,
"%X", p[0] << 8 | p[1]);
p += 2;
strlcat(oline, htmp, sizeof(oline));
s->rwstate = SSL_NOTHING;
s->s3->fatal_alert = alert_descr;
SSLerr(SSL_F_SSL3_READ_BYTES, SSL_AD_REASON_OFFSET + alert_descr);
- BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr);
+ (void) snprintf(tmp, sizeof tmp, "%d", alert_descr);
ERR_add_error_data(2, "SSL alert number ", tmp);
s->shutdown|=SSL_RECEIVED_SHUTDOWN;
SSL_CTX_remove_session(s->ctx, s->session);