We'll interpret a (void) cast on snprintf() to mean it's been verified that
authorguenther <guenther@openbsd.org>
Sat, 19 Apr 2014 11:43:07 +0000 (11:43 +0000)
committerguenther <guenther@openbsd.org>
Sat, 19 Apr 2014 11:43:07 +0000 (11:43 +0000)
truncation is either desirable, not an issue, or is detected and handled later

ok deraadt@

55 files changed:
lib/libcrypto/asn1/a_gentm.c
lib/libcrypto/asn1/a_mbstr.c
lib/libcrypto/asn1/a_strex.c
lib/libcrypto/asn1/a_utctm.c
lib/libcrypto/asn1/asn1_lib.c
lib/libcrypto/asn1/asn1_par.c
lib/libcrypto/bio/b_dump.c
lib/libcrypto/bio/b_sock.c
lib/libcrypto/bio/bio_cb.c
lib/libcrypto/bio/bss_conn.c
lib/libcrypto/bn/bn_print.c
lib/libcrypto/conf/conf_def.c
lib/libcrypto/conf/conf_mod.c
lib/libcrypto/cversion.c
lib/libcrypto/des/ecb_enc.c
lib/libcrypto/engine/eng_padlock.c
lib/libcrypto/err/err.c
lib/libcrypto/err/err_prn.c
lib/libcrypto/objects/obj_dat.c
lib/libcrypto/pem/pem_pkey.c
lib/libcrypto/ts/ts_rsp_sign.c
lib/libcrypto/ui/ui_lib.c
lib/libcrypto/x509/by_dir.c
lib/libcrypto/x509/x509_txt.c
lib/libcrypto/x509v3/v3_alt.c
lib/libssl/src/apps/apps.c
lib/libssl/src/apps/ca.c
lib/libssl/src/apps/enc.c
lib/libssl/src/apps/req.c
lib/libssl/src/apps/s_time.c
lib/libssl/src/crypto/asn1/a_gentm.c
lib/libssl/src/crypto/asn1/a_mbstr.c
lib/libssl/src/crypto/asn1/a_strex.c
lib/libssl/src/crypto/asn1/a_utctm.c
lib/libssl/src/crypto/asn1/asn1_lib.c
lib/libssl/src/crypto/asn1/asn1_par.c
lib/libssl/src/crypto/bio/b_dump.c
lib/libssl/src/crypto/bio/b_sock.c
lib/libssl/src/crypto/bio/bio_cb.c
lib/libssl/src/crypto/bio/bss_conn.c
lib/libssl/src/crypto/bn/bn_print.c
lib/libssl/src/crypto/conf/conf_def.c
lib/libssl/src/crypto/conf/conf_mod.c
lib/libssl/src/crypto/cversion.c
lib/libssl/src/crypto/des/ecb_enc.c
lib/libssl/src/crypto/engine/eng_padlock.c
lib/libssl/src/crypto/err/err.c
lib/libssl/src/crypto/err/err_prn.c
lib/libssl/src/crypto/objects/obj_dat.c
lib/libssl/src/crypto/pem/pem_pkey.c
lib/libssl/src/crypto/ts/ts_rsp_sign.c
lib/libssl/src/crypto/ui/ui_lib.c
lib/libssl/src/crypto/x509/by_dir.c
lib/libssl/src/crypto/x509/x509_txt.c
lib/libssl/src/crypto/x509v3/v3_alt.c

index 856aaf0..f331bff 100644 (file)
@@ -244,7 +244,7 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day,
                s->data = (unsigned char *)p;
        }
 
-       (void) snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900,
+       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;
index 5a909d6..6528161 100644 (file)
@@ -150,14 +150,14 @@ 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);
-               (void) snprintf(strbuf, sizeof strbuf, "%ld", minsize);
+               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);
-               (void) snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
+               snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
                ERR_add_error_data(2, "maxsize=", strbuf);
                return -1;
        }
index 7dc531a..e92c166 100644 (file)
@@ -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) {
-               (void) snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
+               snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
                if(!io_ch(arg, tmphex, 10)) return -1;
                return 10;
        }
        if(c > 0xff) {
-               (void) snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
+               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)) {
-               (void) snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
+               snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
                if(!io_ch(arg, tmphex, 3)) return -1;
                return 3;
        }
index a2325f2..0120b95 100644 (file)
@@ -205,7 +205,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
                s->data=(unsigned char *)p;
        }
 
-       (void) snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
+       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;
index 49d650b..86cfdd3 100644 (file)
@@ -467,8 +467,8 @@ asn1_add_error(const unsigned char *address, int offset)
 {
        char buf1[DECIMAL_SIZE(address) + 1], buf2[DECIMAL_SIZE(offset) + 1];
 
-       (void) snprintf(buf1, sizeof buf1, "%lu", (unsigned long)address);
-       (void) snprintf(buf2, sizeof buf2, "%d", offset);
+       snprintf(buf1, sizeof buf1, "%lu", (unsigned long)address);
+       snprintf(buf2, sizeof buf2, "%d", offset);
        ERR_add_error_data(4, "address=", buf1, " offset=", buf2);
 }
 
index 064b3dc..8085d1e 100644 (file)
@@ -85,13 +85,13 @@ asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
 
        p = str;
        if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
-               (void) snprintf(str, sizeof str, "priv [ %d ] ", tag);
+               snprintf(str, sizeof str, "priv [ %d ] ", tag);
        else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
-               (void) snprintf(str, sizeof str, "cont [ %d ]", tag);
+               snprintf(str, sizeof str, "cont [ %d ]", tag);
        else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
-               (void) snprintf(str, sizeof str, "appl [ %d ]", tag);
+               snprintf(str, sizeof str, "appl [ %d ]", tag);
        else if (tag > 30)
-               (void) snprintf(str, sizeof str, "<ASN1 %d>", tag);
+               snprintf(str, sizeof str, "<ASN1 %d>", tag);
        else
                p = ASN1_tag2str(tag);
 
index 61c9fe2..740686c 100644 (file)
@@ -108,14 +108,14 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
        for (i = 0; i < rows; i++) {
                buf[0] = '\0';  /* start with empty string */
                strlcpy(buf, str, sizeof buf);
-               (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
+               snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
                strlcat(buf, tmp, sizeof buf);
                for (j = 0; j < dump_width; j++) {
                        if (((i*dump_width) + j) >= len) {
                                strlcat(buf, "   ", sizeof buf);
                        } else {
                                ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
-                               (void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
+                               snprintf(tmp, sizeof tmp, "%02x%c", ch,
                                    j == 7 ? '-' : ' ');
                                strlcat(buf, tmp, sizeof buf);
                        }
@@ -125,7 +125,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
                        if (((i*dump_width) + j) >= len)
                                break;
                        ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
-                       (void) snprintf(tmp, sizeof tmp, "%c",
+                       snprintf(tmp, sizeof tmp, "%c",
                            ((ch >= ' ') && (ch <= '~')) ? ch : '.');
                        strlcat(buf, tmp, sizeof buf);
                }
@@ -137,7 +137,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
        }
 #ifdef TRUNCATE
        if (trc > 0) {
-               (void) snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n",
+               snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n",
                    str, len + trc);
                ret += cb((void *)buf, strlen(buf), u);
        }
index a82c79a..a6dd43f 100644 (file)
@@ -543,7 +543,7 @@ BIO_accept(int sock, char **addr)
                        goto end;
                }
                *addr = p;
-               (void) snprintf(*addr, nl, "%s:%s", h, s);
+               snprintf(*addr, nl, "%s:%s", h, s);
                goto end;
        } while (0);
 #endif
@@ -558,7 +558,7 @@ BIO_accept(int sock, char **addr)
                }
                *addr = p;
        }
-       (void) snprintf(*addr, 24, "%d.%d.%d.%d:%d",
+       snprintf(*addr, 24, "%d.%d.%d.%d:%d",
            (unsigned char)(l >> 24L) & 0xff, (unsigned char)(l >> 16L) & 0xff,
            (unsigned char)(l >> 8L) & 0xff, (unsigned char)(l) & 0xff, port);
 
index a272bf9..133d2b7 100644 (file)
@@ -76,62 +76,62 @@ BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl,
        if (BIO_CB_RETURN & cmd)
                r = ret;
 
-       (void) snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
+       snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
        p = &(buf[14]);
        p_maxlen = sizeof buf - 14;
        switch (cmd) {
        case BIO_CB_FREE:
-               (void) snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
+               snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
                break;
        case BIO_CB_READ:
                if (bio->method->type & BIO_TYPE_DESCRIPTOR)
-                       (void) snprintf(p, p_maxlen,
+                       snprintf(p, p_maxlen,
                            "read(%d,%lu) - %s fd=%d\n",
                            bio->num, (unsigned long)argi,
                            bio->method->name, bio->num);
                else
-                       (void) snprintf(p, p_maxlen, "read(%d,%lu) - %s\n",
+                       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)
-                       (void) snprintf(p, p_maxlen,
+                       snprintf(p, p_maxlen,
                            "write(%d,%lu) - %s fd=%d\n",
                            bio->num, (unsigned long)argi,
                            bio->method->name, bio->num);
                else
-                       (void) snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
+                       snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
                            bio->num, (unsigned long)argi, bio->method->name);
                break;
        case BIO_CB_PUTS:
-               (void) snprintf(p, p_maxlen,
+               snprintf(p, p_maxlen,
                    "puts() - %s\n", bio->method->name);
                break;
        case BIO_CB_GETS:
-               (void) snprintf(p, p_maxlen, "gets(%lu) - %s\n",
+               snprintf(p, p_maxlen, "gets(%lu) - %s\n",
                    (unsigned long)argi, bio->method->name);
                break;
        case BIO_CB_CTRL:
-               (void) snprintf(p, p_maxlen, "ctrl(%lu) - %s\n",
+               snprintf(p, p_maxlen, "ctrl(%lu) - %s\n",
                    (unsigned long)argi, bio->method->name);
                break;
        case BIO_CB_RETURN|BIO_CB_READ:
-               (void) snprintf(p, p_maxlen, "read return %ld\n", ret);
+               snprintf(p, p_maxlen, "read return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_WRITE:
-               (void) snprintf(p, p_maxlen, "write return %ld\n", ret);
+               snprintf(p, p_maxlen, "write return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_GETS:
-               (void) snprintf(p, p_maxlen, "gets return %ld\n", ret);
+               snprintf(p, p_maxlen, "gets return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_PUTS:
-               (void) snprintf(p, p_maxlen, "puts return %ld\n", ret);
+               snprintf(p, p_maxlen, "puts return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_CTRL:
-               (void) snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
+               snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
                break;
        default:
-               (void) snprintf(p, p_maxlen,
+               snprintf(p, p_maxlen,
                    "bio callback - unknown type (%d)\n", cmd);
                break;
        }
index fca5d5e..45815fd 100644 (file)
@@ -482,7 +482,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                                char buf[16];
                                unsigned char *p = ptr;
 
-                               (void) snprintf(buf, sizeof buf, "%d.%d.%d.%d",
+                               snprintf(buf, sizeof buf, "%d.%d.%d.%d",
                                    p[0], p[1], p[2], p[3]);
                                if (data->param_hostname != NULL)
                                        free(data->param_hostname);
@@ -491,7 +491,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                        } else if (num == 3) {
                                char buf[DECIMAL_SIZE(int) + 1];
 
-                               (void) snprintf(buf, sizeof buf, "%d",
+                               snprintf(buf, sizeof buf, "%d",
                                    *(int *)ptr);
                                if (data->param_port != NULL)
                                        free(data->param_port);
index e2cab24..49efbcb 100644 (file)
@@ -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. */
-               (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
+               snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
                while (*p) p++;
                while (lp != bn_data)
                        {
                        lp--;
-                       (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
+                       snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
                        while (*p) p++;
                        }
                }
@@ -367,10 +367,10 @@ char *BN_options(void)
                {
                init++;
 #ifdef BN_LLONG
-               (void) snprintf(data,sizeof data,"bn(%d,%d)",
+               snprintf(data,sizeof data,"bn(%d,%d)",
                             (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
 #else
-               (void) snprintf(data,sizeof data,"bn(%d,%d)",
+               snprintf(data,sizeof data,"bn(%d,%d)",
                             (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
 #endif
                }
index 26aee50..5ab995a 100644 (file)
@@ -435,7 +435,7 @@ err:
        if (buff != NULL) BUF_MEM_free(buff);
        if (section != NULL) free(section);
        if (line != NULL) *line=eline;
-       (void) snprintf(btmp,sizeof btmp,"%ld",eline);
+       snprintf(btmp,sizeof btmp,"%ld",eline);
        ERR_add_error_data(2,"line ",btmp);
        if ((h != conf->data) && (conf->data != NULL))
                {
index 2417086..af33451 100644 (file)
@@ -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);
-                       (void) snprintf(rcode, sizeof rcode, "%-8d", ret);
+                       snprintf(rcode, sizeof rcode, "%-8d", ret);
                        ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
                        }
                }
index 7ecfaf9..326216d 100644 (file)
@@ -67,7 +67,7 @@ SSLeay_version(int t)
 #ifdef DATE
                static char buf[sizeof(DATE) + 11];
 
-               (void) snprintf(buf, sizeof buf, "built on: %s", DATE);
+               snprintf(buf, sizeof buf, "built on: %s", DATE);
                return (buf);
 #else
                return("built on: date not available");
@@ -77,7 +77,7 @@ SSLeay_version(int t)
 #ifdef CFLAGS
                static char buf[sizeof(CFLAGS) + 11];
 
-               (void) snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
+               snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
                return (buf);
 #else
                return("compiler: information not available");
@@ -87,7 +87,7 @@ SSLeay_version(int t)
 #ifdef PLATFORM
                static char buf[sizeof(PLATFORM) + 11];
 
-               (void) snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
+               snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
                return (buf);
 #else
                return("platform: information not available");
index b83fca7..f357333 100644 (file)
@@ -97,7 +97,7 @@ const char *DES_options(void)
                        size="int";
                else
                        size="long";
-               (void) snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
+               snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
                             size);
                init=0;
                }
index d5d9a16..a007685 100644 (file)
@@ -177,7 +177,7 @@ padlock_bind_helper(ENGINE *e)
 #endif
 
        /* Generate a nice engine name with available features */
-       (void) snprintf(padlock_name, sizeof(padlock_name),
+       snprintf(padlock_name, sizeof(padlock_name),
                "VIA PadLock (%s, %s)", 
                 padlock_use_rng ? "RNG" : "no-RNG",
                 padlock_use_ace ? "ACE" : "no-ACE");
index 0672477..c4192c6 100644 (file)
@@ -842,13 +842,13 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len)
        rs=ERR_reason_error_string(e);
 
        if (ls == NULL) 
-               (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
+               snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
        if (fs == NULL)
-               (void) snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
+               snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
        if (rs == NULL)
-               (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
+               snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
 
-       (void) snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, 
+       snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, 
                fs?fs:fsbuf, rs?rs:rsbuf);
        if (strlen(buf) == len-1)
                {
index 7374c0a..be4d5de 100644 (file)
@@ -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);
-               (void) snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
+               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 */
index b3388b1..cc007f1 100644 (file)
@@ -594,7 +594,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
                        }
                else
                        {
-                       (void) snprintf(tbuf,sizeof tbuf,".%lu",l);
+                       snprintf(tbuf,sizeof tbuf,".%lu",l);
                        i=strlen(tbuf);
                        if (buf && (buf_len > 0))
                                {
index a3b609b..c8cf00d 100644 (file)
@@ -147,7 +147,7 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
                                                        (char *)kstr, klen,
                                                        cb, u);
 
-       (void) snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
+       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;
 
-       (void) snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
+       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);
index e52c9ff..58d5864 100644 (file)
@@ -983,7 +983,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time,
                   if the elements correspond to 0, they MUST be wholly
                   omitted, and the decimal point element also MUST be
                   omitted." */
-               (void)snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
+               snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
                /* truncate and trim trailing 0 */
                usecstr[precision + 1] = '\0';
                p = usecstr + strlen(usecstr) - 1;
index 58e4c5d..4138c86 100644 (file)
@@ -844,9 +844,9 @@ 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];
 
-                       (void) snprintf(number1, sizeof(number1), "%d",
+                       snprintf(number1, sizeof(number1), "%d",
                            uis->_.string_data.result_minsize);
-                       (void) snprintf(number2, sizeof(number2), "%d",
+                       snprintf(number2, sizeof(number2), "%d",
                            uis->_.string_data.result_maxsize);
 
                        if (l < uis->_.string_data.result_minsize) {
index 749323b..ee1838a 100644 (file)
@@ -336,7 +336,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
                        hent = NULL;
                }
                for (;;) {
-                       (void) snprintf(b->data, b->max, "%s/%08lx.%s%d",
+                       snprintf(b->data, b->max, "%s/%08lx.%s%d",
                            ent->dir, h, postfix, k);
 
 #ifndef OPENSSL_NO_POSIX_IO
index 5099486..8caf18a 100644 (file)
@@ -184,7 +184,7 @@ const char *X509_verify_cert_error_string(long n)
                return("CRL path validation error");
 
        default:
-               (void) snprintf(buf,sizeof buf,"error number %ld",n);
+               snprintf(buf,sizeof buf,"error number %ld",n);
                return(buf);
        }
 }
index 636677d..95b1fa4 100644 (file)
@@ -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)
-                       (void) snprintf(oline, sizeof oline,
+                       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++)
                                {
-                               (void) snprintf(htmp, sizeof htmp,
+                               snprintf(htmp, sizeof htmp,
                                             "%X", p[0] << 8 | p[1]);
                                p += 2;
                                strlcat(oline, htmp, sizeof(oline));
index 4a8be99..9a731fe 100644 (file)
@@ -1449,7 +1449,7 @@ save_serial(char *serialfile, char *suffix, BIGNUM * serial,
        if (suffix == NULL)
                strlcpy(buf[0], serialfile, BSIZE);
        else
-               (void) snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
+               snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
 #ifdef RL_DEBUG
        BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
 #endif
@@ -1495,9 +1495,9 @@ rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
                BIO_printf(bio_err, "file name too long\n");
                goto err;
        }
-       (void) snprintf(buf[0], sizeof buf[0], "%s.%s",
+       snprintf(buf[0], sizeof buf[0], "%s.%s",
            serialfile, new_suffix);
-       (void) snprintf(buf[1], sizeof buf[1], "%s.%s",
+       snprintf(buf[1], sizeof buf[1], "%s.%s",
            serialfile, old_suffix);
 #ifdef RL_DEBUG
        BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
@@ -1580,7 +1580,7 @@ load_index(char *dbfile, DB_ATTR * db_attr)
        if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL)
                goto err;
 
-       (void) snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
+       snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
        dbattr_conf = NCONF_new(NULL);
        if (NCONF_load(dbattr_conf, buf[0], &errorline) <= 0) {
                if (errorline > 0) {
@@ -1661,9 +1661,9 @@ save_index(const char *dbfile, const char *suffix, CA_DB * db)
                BIO_printf(bio_err, "file name too long\n");
                goto err;
        }
-       (void) snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
-       (void) snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
-       (void) snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
+       snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
+       snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
+       snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
 #ifdef RL_DEBUG
        BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
 #endif
@@ -1710,14 +1710,14 @@ rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix)
                BIO_printf(bio_err, "file name too long\n");
                goto err;
        }
-       (void) snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
-       (void) snprintf(buf[2], sizeof buf[2], "%s.attr.%s",
+       snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
+       snprintf(buf[2], sizeof buf[2], "%s.attr.%s",
            dbfile, new_suffix);
-       (void) snprintf(buf[0], sizeof buf[0], "%s.%s",
+       snprintf(buf[0], sizeof buf[0], "%s.%s",
            dbfile, new_suffix);
-       (void) snprintf(buf[1], sizeof buf[1], "%s.%s",
+       snprintf(buf[1], sizeof buf[1], "%s.%s",
            dbfile, old_suffix);
-       (void) snprintf(buf[3], sizeof buf[3], "%s.attr.%s",
+       snprintf(buf[3], sizeof buf[3], "%s.attr.%s",
            dbfile, old_suffix);
 #ifdef RL_DEBUG
        BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
index 3f2d106..c70ca5f 100644 (file)
@@ -1143,7 +1143,7 @@ ca_main(int argc, char **argv)
                                for (k = 0; k < j; k++) {
                                        if (n >= &(buf[2][sizeof(buf[2])]))
                                                break;
-                                       (void) snprintf(n,
+                                       snprintf(n,
                                            &buf[2][0] + sizeof(buf[2]) - n,
                                            "%02X", (unsigned char) *(p++));
                                        n += 2;
index 1876011..c8f0410 100644 (file)
@@ -388,7 +388,7 @@ enc_main(int argc, char **argv)
                for (;;) {
                        char buf[200];
 
-                       (void) snprintf(buf, sizeof buf, "enter %s %s password:",
+                       snprintf(buf, sizeof buf, "enter %s %s password:",
                            OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
                            (enc) ? "encryption" : "decryption");
                        strbuf[0] = '\0';
index 1ed8c84..38428f8 100644 (file)
@@ -1081,17 +1081,17 @@ start:          for (;;) {
                                ERR_clear_error();
                                def = "";
                        }
-                       (void) snprintf(buf, sizeof buf, "%s_value", v->name);
+                       snprintf(buf, sizeof buf, "%s_value", v->name);
                        if ((value = NCONF_get_string(req_conf, dn_sect, buf)) == NULL) {
                                ERR_clear_error();
                                value = NULL;
                        }
-                       (void) snprintf(buf, sizeof buf, "%s_min", v->name);
+                       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;
                        }
-                       (void) snprintf(buf, sizeof buf, "%s_max", v->name);
+                       snprintf(buf, sizeof buf, "%s_max", v->name);
                        if (!NCONF_get_number(req_conf, dn_sect, buf, &n_max)) {
                                ERR_clear_error();
                                n_max = -1;
@@ -1131,18 +1131,18 @@ start:          for (;;) {
                                        ERR_clear_error();
                                        def = "";
                                }
-                               (void) snprintf(buf, sizeof buf, "%s_value", type);
+                               snprintf(buf, sizeof buf, "%s_value", type);
                                if ((value = NCONF_get_string(req_conf, attr_sect, buf))
                                    == NULL) {
                                        ERR_clear_error();
                                        value = NULL;
                                }
-                               (void) snprintf(buf, sizeof buf, "%s_min", type);
+                               snprintf(buf, sizeof buf, "%s_min", type);
                                if (!NCONF_get_number(req_conf, attr_sect, buf, &n_min)) {
                                        ERR_clear_error();
                                        n_min = -1;
                                }
-                               (void) snprintf(buf, sizeof buf, "%s_max", type);
+                               snprintf(buf, sizeof buf, "%s_max", type);
                                if (!NCONF_get_number(req_conf, attr_sect, buf, &n_max)) {
                                        ERR_clear_error();
                                        n_max = -1;
index f74c9b9..e7fc7e2 100644 (file)
@@ -398,7 +398,7 @@ s_time_main(int argc, char **argv)
                        goto end;
 
                if (s_www_path != NULL) {
-                       (void) snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path);
+                       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;
@@ -453,7 +453,7 @@ next:
                goto end;
        }
        if (s_www_path != NULL) {
-               (void) snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path);
+               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);
        }
@@ -490,7 +490,7 @@ next:
                        goto end;
 
                if (s_www_path) {
-                       (void) snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path);
+                       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;
index 856aaf0..f331bff 100644 (file)
@@ -244,7 +244,7 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day,
                s->data = (unsigned char *)p;
        }
 
-       (void) snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900,
+       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;
index 5a909d6..6528161 100644 (file)
@@ -150,14 +150,14 @@ 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);
-               (void) snprintf(strbuf, sizeof strbuf, "%ld", minsize);
+               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);
-               (void) snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
+               snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
                ERR_add_error_data(2, "maxsize=", strbuf);
                return -1;
        }
index 7dc531a..e92c166 100644 (file)
@@ -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) {
-               (void) snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
+               snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
                if(!io_ch(arg, tmphex, 10)) return -1;
                return 10;
        }
        if(c > 0xff) {
-               (void) snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
+               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)) {
-               (void) snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
+               snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
                if(!io_ch(arg, tmphex, 3)) return -1;
                return 3;
        }
index a2325f2..0120b95 100644 (file)
@@ -205,7 +205,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
                s->data=(unsigned char *)p;
        }
 
-       (void) snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
+       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;
index 49d650b..86cfdd3 100644 (file)
@@ -467,8 +467,8 @@ asn1_add_error(const unsigned char *address, int offset)
 {
        char buf1[DECIMAL_SIZE(address) + 1], buf2[DECIMAL_SIZE(offset) + 1];
 
-       (void) snprintf(buf1, sizeof buf1, "%lu", (unsigned long)address);
-       (void) snprintf(buf2, sizeof buf2, "%d", offset);
+       snprintf(buf1, sizeof buf1, "%lu", (unsigned long)address);
+       snprintf(buf2, sizeof buf2, "%d", offset);
        ERR_add_error_data(4, "address=", buf1, " offset=", buf2);
 }
 
index 064b3dc..8085d1e 100644 (file)
@@ -85,13 +85,13 @@ asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
 
        p = str;
        if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
-               (void) snprintf(str, sizeof str, "priv [ %d ] ", tag);
+               snprintf(str, sizeof str, "priv [ %d ] ", tag);
        else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
-               (void) snprintf(str, sizeof str, "cont [ %d ]", tag);
+               snprintf(str, sizeof str, "cont [ %d ]", tag);
        else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
-               (void) snprintf(str, sizeof str, "appl [ %d ]", tag);
+               snprintf(str, sizeof str, "appl [ %d ]", tag);
        else if (tag > 30)
-               (void) snprintf(str, sizeof str, "<ASN1 %d>", tag);
+               snprintf(str, sizeof str, "<ASN1 %d>", tag);
        else
                p = ASN1_tag2str(tag);
 
index 61c9fe2..740686c 100644 (file)
@@ -108,14 +108,14 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
        for (i = 0; i < rows; i++) {
                buf[0] = '\0';  /* start with empty string */
                strlcpy(buf, str, sizeof buf);
-               (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
+               snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
                strlcat(buf, tmp, sizeof buf);
                for (j = 0; j < dump_width; j++) {
                        if (((i*dump_width) + j) >= len) {
                                strlcat(buf, "   ", sizeof buf);
                        } else {
                                ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
-                               (void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
+                               snprintf(tmp, sizeof tmp, "%02x%c", ch,
                                    j == 7 ? '-' : ' ');
                                strlcat(buf, tmp, sizeof buf);
                        }
@@ -125,7 +125,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
                        if (((i*dump_width) + j) >= len)
                                break;
                        ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
-                       (void) snprintf(tmp, sizeof tmp, "%c",
+                       snprintf(tmp, sizeof tmp, "%c",
                            ((ch >= ' ') && (ch <= '~')) ? ch : '.');
                        strlcat(buf, tmp, sizeof buf);
                }
@@ -137,7 +137,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
        }
 #ifdef TRUNCATE
        if (trc > 0) {
-               (void) snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n",
+               snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n",
                    str, len + trc);
                ret += cb((void *)buf, strlen(buf), u);
        }
index a82c79a..a6dd43f 100644 (file)
@@ -543,7 +543,7 @@ BIO_accept(int sock, char **addr)
                        goto end;
                }
                *addr = p;
-               (void) snprintf(*addr, nl, "%s:%s", h, s);
+               snprintf(*addr, nl, "%s:%s", h, s);
                goto end;
        } while (0);
 #endif
@@ -558,7 +558,7 @@ BIO_accept(int sock, char **addr)
                }
                *addr = p;
        }
-       (void) snprintf(*addr, 24, "%d.%d.%d.%d:%d",
+       snprintf(*addr, 24, "%d.%d.%d.%d:%d",
            (unsigned char)(l >> 24L) & 0xff, (unsigned char)(l >> 16L) & 0xff,
            (unsigned char)(l >> 8L) & 0xff, (unsigned char)(l) & 0xff, port);
 
index a272bf9..133d2b7 100644 (file)
@@ -76,62 +76,62 @@ BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl,
        if (BIO_CB_RETURN & cmd)
                r = ret;
 
-       (void) snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
+       snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
        p = &(buf[14]);
        p_maxlen = sizeof buf - 14;
        switch (cmd) {
        case BIO_CB_FREE:
-               (void) snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
+               snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
                break;
        case BIO_CB_READ:
                if (bio->method->type & BIO_TYPE_DESCRIPTOR)
-                       (void) snprintf(p, p_maxlen,
+                       snprintf(p, p_maxlen,
                            "read(%d,%lu) - %s fd=%d\n",
                            bio->num, (unsigned long)argi,
                            bio->method->name, bio->num);
                else
-                       (void) snprintf(p, p_maxlen, "read(%d,%lu) - %s\n",
+                       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)
-                       (void) snprintf(p, p_maxlen,
+                       snprintf(p, p_maxlen,
                            "write(%d,%lu) - %s fd=%d\n",
                            bio->num, (unsigned long)argi,
                            bio->method->name, bio->num);
                else
-                       (void) snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
+                       snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
                            bio->num, (unsigned long)argi, bio->method->name);
                break;
        case BIO_CB_PUTS:
-               (void) snprintf(p, p_maxlen,
+               snprintf(p, p_maxlen,
                    "puts() - %s\n", bio->method->name);
                break;
        case BIO_CB_GETS:
-               (void) snprintf(p, p_maxlen, "gets(%lu) - %s\n",
+               snprintf(p, p_maxlen, "gets(%lu) - %s\n",
                    (unsigned long)argi, bio->method->name);
                break;
        case BIO_CB_CTRL:
-               (void) snprintf(p, p_maxlen, "ctrl(%lu) - %s\n",
+               snprintf(p, p_maxlen, "ctrl(%lu) - %s\n",
                    (unsigned long)argi, bio->method->name);
                break;
        case BIO_CB_RETURN|BIO_CB_READ:
-               (void) snprintf(p, p_maxlen, "read return %ld\n", ret);
+               snprintf(p, p_maxlen, "read return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_WRITE:
-               (void) snprintf(p, p_maxlen, "write return %ld\n", ret);
+               snprintf(p, p_maxlen, "write return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_GETS:
-               (void) snprintf(p, p_maxlen, "gets return %ld\n", ret);
+               snprintf(p, p_maxlen, "gets return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_PUTS:
-               (void) snprintf(p, p_maxlen, "puts return %ld\n", ret);
+               snprintf(p, p_maxlen, "puts return %ld\n", ret);
                break;
        case BIO_CB_RETURN|BIO_CB_CTRL:
-               (void) snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
+               snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
                break;
        default:
-               (void) snprintf(p, p_maxlen,
+               snprintf(p, p_maxlen,
                    "bio callback - unknown type (%d)\n", cmd);
                break;
        }
index fca5d5e..45815fd 100644 (file)
@@ -482,7 +482,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                                char buf[16];
                                unsigned char *p = ptr;
 
-                               (void) snprintf(buf, sizeof buf, "%d.%d.%d.%d",
+                               snprintf(buf, sizeof buf, "%d.%d.%d.%d",
                                    p[0], p[1], p[2], p[3]);
                                if (data->param_hostname != NULL)
                                        free(data->param_hostname);
@@ -491,7 +491,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                        } else if (num == 3) {
                                char buf[DECIMAL_SIZE(int) + 1];
 
-                               (void) snprintf(buf, sizeof buf, "%d",
+                               snprintf(buf, sizeof buf, "%d",
                                    *(int *)ptr);
                                if (data->param_port != NULL)
                                        free(data->param_port);
index e2cab24..49efbcb 100644 (file)
@@ -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. */
-               (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
+               snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
                while (*p) p++;
                while (lp != bn_data)
                        {
                        lp--;
-                       (void) snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
+                       snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
                        while (*p) p++;
                        }
                }
@@ -367,10 +367,10 @@ char *BN_options(void)
                {
                init++;
 #ifdef BN_LLONG
-               (void) snprintf(data,sizeof data,"bn(%d,%d)",
+               snprintf(data,sizeof data,"bn(%d,%d)",
                             (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
 #else
-               (void) snprintf(data,sizeof data,"bn(%d,%d)",
+               snprintf(data,sizeof data,"bn(%d,%d)",
                             (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
 #endif
                }
index 26aee50..5ab995a 100644 (file)
@@ -435,7 +435,7 @@ err:
        if (buff != NULL) BUF_MEM_free(buff);
        if (section != NULL) free(section);
        if (line != NULL) *line=eline;
-       (void) snprintf(btmp,sizeof btmp,"%ld",eline);
+       snprintf(btmp,sizeof btmp,"%ld",eline);
        ERR_add_error_data(2,"line ",btmp);
        if ((h != conf->data) && (conf->data != NULL))
                {
index 2417086..af33451 100644 (file)
@@ -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);
-                       (void) snprintf(rcode, sizeof rcode, "%-8d", ret);
+                       snprintf(rcode, sizeof rcode, "%-8d", ret);
                        ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
                        }
                }
index 7ecfaf9..326216d 100644 (file)
@@ -67,7 +67,7 @@ SSLeay_version(int t)
 #ifdef DATE
                static char buf[sizeof(DATE) + 11];
 
-               (void) snprintf(buf, sizeof buf, "built on: %s", DATE);
+               snprintf(buf, sizeof buf, "built on: %s", DATE);
                return (buf);
 #else
                return("built on: date not available");
@@ -77,7 +77,7 @@ SSLeay_version(int t)
 #ifdef CFLAGS
                static char buf[sizeof(CFLAGS) + 11];
 
-               (void) snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
+               snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
                return (buf);
 #else
                return("compiler: information not available");
@@ -87,7 +87,7 @@ SSLeay_version(int t)
 #ifdef PLATFORM
                static char buf[sizeof(PLATFORM) + 11];
 
-               (void) snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
+               snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
                return (buf);
 #else
                return("platform: information not available");
index b83fca7..f357333 100644 (file)
@@ -97,7 +97,7 @@ const char *DES_options(void)
                        size="int";
                else
                        size="long";
-               (void) snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
+               snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
                             size);
                init=0;
                }
index d5d9a16..a007685 100644 (file)
@@ -177,7 +177,7 @@ padlock_bind_helper(ENGINE *e)
 #endif
 
        /* Generate a nice engine name with available features */
-       (void) snprintf(padlock_name, sizeof(padlock_name),
+       snprintf(padlock_name, sizeof(padlock_name),
                "VIA PadLock (%s, %s)", 
                 padlock_use_rng ? "RNG" : "no-RNG",
                 padlock_use_ace ? "ACE" : "no-ACE");
index 0672477..c4192c6 100644 (file)
@@ -842,13 +842,13 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len)
        rs=ERR_reason_error_string(e);
 
        if (ls == NULL) 
-               (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
+               snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
        if (fs == NULL)
-               (void) snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
+               snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
        if (rs == NULL)
-               (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
+               snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
 
-       (void) snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, 
+       snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, 
                fs?fs:fsbuf, rs?rs:rsbuf);
        if (strlen(buf) == len-1)
                {
index 7374c0a..be4d5de 100644 (file)
@@ -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);
-               (void) snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
+               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 */
index b3388b1..cc007f1 100644 (file)
@@ -594,7 +594,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
                        }
                else
                        {
-                       (void) snprintf(tbuf,sizeof tbuf,".%lu",l);
+                       snprintf(tbuf,sizeof tbuf,".%lu",l);
                        i=strlen(tbuf);
                        if (buf && (buf_len > 0))
                                {
index a3b609b..c8cf00d 100644 (file)
@@ -147,7 +147,7 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
                                                        (char *)kstr, klen,
                                                        cb, u);
 
-       (void) snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
+       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;
 
-       (void) snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
+       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);
index e52c9ff..58d5864 100644 (file)
@@ -983,7 +983,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time,
                   if the elements correspond to 0, they MUST be wholly
                   omitted, and the decimal point element also MUST be
                   omitted." */
-               (void)snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
+               snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
                /* truncate and trim trailing 0 */
                usecstr[precision + 1] = '\0';
                p = usecstr + strlen(usecstr) - 1;
index 58e4c5d..4138c86 100644 (file)
@@ -844,9 +844,9 @@ 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];
 
-                       (void) snprintf(number1, sizeof(number1), "%d",
+                       snprintf(number1, sizeof(number1), "%d",
                            uis->_.string_data.result_minsize);
-                       (void) snprintf(number2, sizeof(number2), "%d",
+                       snprintf(number2, sizeof(number2), "%d",
                            uis->_.string_data.result_maxsize);
 
                        if (l < uis->_.string_data.result_minsize) {
index 749323b..ee1838a 100644 (file)
@@ -336,7 +336,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
                        hent = NULL;
                }
                for (;;) {
-                       (void) snprintf(b->data, b->max, "%s/%08lx.%s%d",
+                       snprintf(b->data, b->max, "%s/%08lx.%s%d",
                            ent->dir, h, postfix, k);
 
 #ifndef OPENSSL_NO_POSIX_IO
index 5099486..8caf18a 100644 (file)
@@ -184,7 +184,7 @@ const char *X509_verify_cert_error_string(long n)
                return("CRL path validation error");
 
        default:
-               (void) snprintf(buf,sizeof buf,"error number %ld",n);
+               snprintf(buf,sizeof buf,"error number %ld",n);
                return(buf);
        }
 }
index 636677d..95b1fa4 100644 (file)
@@ -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)
-                       (void) snprintf(oline, sizeof oline,
+                       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++)
                                {
-                               (void) snprintf(htmp, sizeof htmp,
+                               snprintf(htmp, sizeof htmp,
                                             "%X", p[0] << 8 | p[1]);
                                p += 2;
                                strlcat(oline, htmp, sizeof(oline));