diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2014-04-15 16:21:05 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2014-04-15 16:21:05 +0000 |
commit | fcd74ba7aa271885eb12554ad9070defd36a05c9 (patch) | |
tree | eda55802f589b4c22802fb2af35147dcc283e21e /lib | |
parent | ad04ca41f9e0f0c8e6aa9159f577ff7e899d45e8 (diff) |
Part 1 of eliminating BIO_snprintf(). This fixes mechanical conversions
where the return value is ignored changing to (void) snprintf.
ok deraadt@
Diffstat (limited to 'lib')
26 files changed, 70 insertions, 70 deletions
diff --git a/lib/libcrypto/asn1/a_gentm.c b/lib/libcrypto/asn1/a_gentm.c index c79c6f538cd..04266e790a6 100644 --- a/lib/libcrypto/asn1/a_gentm.c +++ b/lib/libcrypto/asn1/a_gentm.c @@ -252,7 +252,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, 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; diff --git a/lib/libcrypto/asn1/a_mbstr.c b/lib/libcrypto/asn1/a_mbstr.c index 1538e0a4fc2..264d8f677f0 100644 --- a/lib/libcrypto/asn1/a_mbstr.c +++ b/lib/libcrypto/asn1/a_mbstr.c @@ -145,14 +145,14 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, 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; } diff --git a/lib/libcrypto/asn1/a_strex.c b/lib/libcrypto/asn1/a_strex.c index ead37ac3258..d1a587ccc19 100644 --- a/lib/libcrypto/asn1/a_strex.c +++ b/lib/libcrypto/asn1/a_strex.c @@ -125,12 +125,12 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch 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; } @@ -149,7 +149,7 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch 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; } diff --git a/lib/libcrypto/asn1/a_utctm.c b/lib/libcrypto/asn1/a_utctm.c index 072e2365923..615395b7389 100644 --- a/lib/libcrypto/asn1/a_utctm.c +++ b/lib/libcrypto/asn1/a_utctm.c @@ -229,7 +229,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, 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; diff --git a/lib/libcrypto/asn1/asn1_lib.c b/lib/libcrypto/asn1/asn1_lib.c index 1bcb44aee20..4d1d6af18d8 100644 --- a/lib/libcrypto/asn1/asn1_lib.c +++ b/lib/libcrypto/asn1/asn1_lib.c @@ -464,8 +464,8 @@ void asn1_add_error(const unsigned char *address, int offset) { 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); } diff --git a/lib/libcrypto/asn1/asn1_par.c b/lib/libcrypto/asn1/asn1_par.c index aaca69aebd9..29b0ba46b5d 100644 --- a/lib/libcrypto/asn1/asn1_par.c +++ b/lib/libcrypto/asn1/asn1_par.c @@ -82,13 +82,13 @@ static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, 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); diff --git a/lib/libcrypto/bio/b_dump.c b/lib/libcrypto/bio/b_dump.c index c80ecc42953..492ee09275e 100644 --- a/lib/libcrypto/bio/b_dump.c +++ b/lib/libcrypto/bio/b_dump.c @@ -107,7 +107,7 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), { 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++) { @@ -118,7 +118,7 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), 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); } @@ -130,10 +130,10 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), 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] : '.'); @@ -149,7 +149,7 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), #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); } diff --git a/lib/libcrypto/bio/b_sock.c b/lib/libcrypto/bio/b_sock.c index 779acbaaf5a..bd433074567 100644 --- a/lib/libcrypto/bio/b_sock.c +++ b/lib/libcrypto/bio/b_sock.c @@ -916,7 +916,7 @@ int BIO_accept(int sock, char **addr) 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 @@ -932,7 +932,7 @@ int BIO_accept(int sock, char **addr) } *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, diff --git a/lib/libcrypto/bio/bio_cb.c b/lib/libcrypto/bio/bio_cb.c index 7334a254bf3..78c8974ab45 100644 --- a/lib/libcrypto/bio/bio_cb.c +++ b/lib/libcrypto/bio/bio_cb.c @@ -75,60 +75,60 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, 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; } diff --git a/lib/libcrypto/bio/bss_conn.c b/lib/libcrypto/bio/bss_conn.c index 42ddf1f4aad..5162e75c879 100644 --- a/lib/libcrypto/bio/bss_conn.c +++ b/lib/libcrypto/bio/bss_conn.c @@ -521,7 +521,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) 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); @@ -532,7 +532,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) { 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); diff --git a/lib/libcrypto/bn/bn_print.c b/lib/libcrypto/bn/bn_print.c index 1743b6a7e21..c7c407e4943 100644 --- a/lib/libcrypto/bn/bn_print.c +++ b/lib/libcrypto/bn/bn_print.c @@ -147,12 +147,12 @@ char *BN_bn2dec(const BIGNUM *a) /* 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++; } } @@ -367,10 +367,10 @@ char *BN_options(void) { 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 } diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c index cf951320af8..15e5613e365 100644 --- a/lib/libcrypto/conf/conf_def.c +++ b/lib/libcrypto/conf/conf_def.c @@ -439,7 +439,7 @@ err: 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)) { diff --git a/lib/libcrypto/conf/conf_mod.c b/lib/libcrypto/conf/conf_mod.c index df1642a0a56..994294f6558 100644 --- a/lib/libcrypto/conf/conf_mod.c +++ b/lib/libcrypto/conf/conf_mod.c @@ -233,7 +233,7 @@ static int module_run(const CONF *cnf, char *name, char *value, { 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); } } diff --git a/lib/libcrypto/cversion.c b/lib/libcrypto/cversion.c index 1fe92a4bfa2..4bbe74bd5b6 100644 --- a/lib/libcrypto/cversion.c +++ b/lib/libcrypto/cversion.c @@ -71,7 +71,7 @@ const char #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"); @@ -81,7 +81,7 @@ const char #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"); @@ -91,7 +91,7 @@ const char #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"); diff --git a/lib/libcrypto/des/ecb_enc.c b/lib/libcrypto/des/ecb_enc.c index 0684e769b3e..b83fca71db3 100644 --- a/lib/libcrypto/des/ecb_enc.c +++ b/lib/libcrypto/des/ecb_enc.c @@ -97,7 +97,7 @@ const char *DES_options(void) 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; } diff --git a/lib/libcrypto/engine/eng_padlock.c b/lib/libcrypto/engine/eng_padlock.c index 9f7a85a8da5..d1fc8d93151 100644 --- a/lib/libcrypto/engine/eng_padlock.c +++ b/lib/libcrypto/engine/eng_padlock.c @@ -178,7 +178,7 @@ padlock_bind_helper(ENGINE *e) #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"); diff --git a/lib/libcrypto/err/err.c b/lib/libcrypto/err/err.c index 0251248bafd..ae9a209ad7b 100644 --- a/lib/libcrypto/err/err.c +++ b/lib/libcrypto/err/err.c @@ -872,13 +872,13 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len) 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) { diff --git a/lib/libcrypto/err/err_prn.c b/lib/libcrypto/err/err_prn.c index a0168ac8ed6..7374c0abe79 100644 --- a/lib/libcrypto/err/err_prn.c +++ b/lib/libcrypto/err/err_prn.c @@ -79,7 +79,7 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), 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 */ diff --git a/lib/libcrypto/mem_dbg.c b/lib/libcrypto/mem_dbg.c index 9324ec4c7dd..944c3d9a617 100644 --- a/lib/libcrypto/mem_dbg.c +++ b/lib/libcrypto/mem_dbg.c @@ -665,22 +665,22 @@ print_leak_doall_arg(const MEM *m, MEM_LEAK *l) 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); @@ -701,7 +701,7 @@ print_leak_doall_arg(const MEM *m, MEM_LEAK *l) 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); @@ -715,7 +715,7 @@ print_leak_doall_arg(const MEM *m, MEM_LEAK *l) 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); diff --git a/lib/libcrypto/objects/obj_dat.c b/lib/libcrypto/objects/obj_dat.c index 99646c300c1..a597284c808 100644 --- a/lib/libcrypto/objects/obj_dat.c +++ b/lib/libcrypto/objects/obj_dat.c @@ -594,7 +594,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) } else { - BIO_snprintf(tbuf,sizeof tbuf,".%lu",l); + (void) snprintf(tbuf,sizeof tbuf,".%lu",l); i=strlen(tbuf); if (buf && (buf_len > 0)) { diff --git a/lib/libcrypto/pem/pem_pkey.c b/lib/libcrypto/pem/pem_pkey.c index 8ecf24903bc..ef152be2641 100644 --- a/lib/libcrypto/pem/pem_pkey.c +++ b/lib/libcrypto/pem/pem_pkey.c @@ -147,7 +147,7 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, (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); } @@ -199,7 +199,7 @@ int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x) 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); diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c index a8abc270642..6113060aa90 100644 --- a/lib/libcrypto/ui/ui_lib.c +++ b/lib/libcrypto/ui/ui_lib.c @@ -858,9 +858,9 @@ int UI_set_result(UI *ui, UI_STRING *uis, const char *result) 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) diff --git a/lib/libcrypto/x509/by_dir.c b/lib/libcrypto/x509/by_dir.c index c6602dae4f5..f9d55c4e6d7 100644 --- a/lib/libcrypto/x509/by_dir.c +++ b/lib/libcrypto/x509/by_dir.c @@ -379,13 +379,13 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, { /* 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); } diff --git a/lib/libcrypto/x509/x509_txt.c b/lib/libcrypto/x509/x509_txt.c index c44f753c462..27f6c7176ae 100644 --- a/lib/libcrypto/x509/x509_txt.c +++ b/lib/libcrypto/x509/x509_txt.c @@ -185,7 +185,7 @@ const char *X509_verify_cert_error_string(long n) 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); } } diff --git a/lib/libcrypto/x509v3/v3_alt.c b/lib/libcrypto/x509v3/v3_alt.c index 91aefcddc1b..66ea96db514 100644 --- a/lib/libcrypto/x509v3/v3_alt.c +++ b/lib/libcrypto/x509v3/v3_alt.c @@ -143,14 +143,14 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, 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)); diff --git a/lib/libssl/s3_pkt.c b/lib/libssl/s3_pkt.c index 70e6acad4f9..c9a7b6cf073 100644 --- a/lib/libssl/s3_pkt.c +++ b/lib/libssl/s3_pkt.c @@ -1161,7 +1161,7 @@ start: 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); |