summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/bio/b_print.c
diff options
context:
space:
mode:
authorsimon <simon@FreeBSD.org>2006-07-29 19:10:21 +0000
committersimon <simon@FreeBSD.org>2006-07-29 19:10:21 +0000
commitfb3c70eda88d3175627edc6a3316b4508b3d29c5 (patch)
tree213a0c4d5ba3869f66ecf970819532048fed4a9d /crypto/openssl/crypto/bio/b_print.c
parent3c8d7d9993705e30bc69e55cd19d8a298e582292 (diff)
downloadFreeBSD-src-fb3c70eda88d3175627edc6a3316b4508b3d29c5.zip
FreeBSD-src-fb3c70eda88d3175627edc6a3316b4508b3d29c5.tar.gz
Vendor import of OpenSSL 0.9.8b
Diffstat (limited to 'crypto/openssl/crypto/bio/b_print.c')
-rw-r--r--crypto/openssl/crypto/bio/b_print.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/crypto/openssl/crypto/bio/b_print.c b/crypto/openssl/crypto/bio/b_print.c
index c2bb357..4857cfe 100644
--- a/crypto/openssl/crypto/bio/b_print.c
+++ b/crypto/openssl/crypto/bio/b_print.c
@@ -482,7 +482,7 @@ fmtint(
int flags)
{
int signvalue = 0;
- char *prefix = "";
+ const char *prefix = "";
unsigned LLONG uvalue;
char convert[DECIMAL_SIZE(value)+3];
int place = 0;
@@ -513,8 +513,8 @@ fmtint(
(caps ? "0123456789ABCDEF" : "0123456789abcdef")
[uvalue % (unsigned) base];
uvalue = (uvalue / (unsigned) base);
- } while (uvalue && (place < sizeof convert));
- if (place == sizeof convert)
+ } while (uvalue && (place < (int)sizeof(convert)));
+ if (place == sizeof(convert))
place--;
convert[place] = 0;
@@ -576,7 +576,7 @@ abs_val(LDOUBLE value)
}
static LDOUBLE
-pow10(int in_exp)
+pow_10(int in_exp)
{
LDOUBLE result = 1;
while (in_exp) {
@@ -619,6 +619,7 @@ fmtfp(
int caps = 0;
long intpart;
long fracpart;
+ long max10;
if (max < 0)
max = 6;
@@ -639,11 +640,12 @@ fmtfp(
/* we "cheat" by converting the fractional part to integer by
multiplying by a factor of 10 */
- fracpart = roundv((pow10(max)) * (ufvalue - intpart));
+ max10 = roundv(pow_10(max));
+ fracpart = roundv(pow_10(max) * (ufvalue - intpart));
- if (fracpart >= (long)pow10(max)) {
+ if (fracpart >= max10) {
intpart++;
- fracpart -= (long)pow10(max);
+ fracpart -= max10;
}
/* convert integer part */
@@ -652,7 +654,7 @@ fmtfp(
(caps ? "0123456789ABCDEF"
: "0123456789abcdef")[intpart % 10];
intpart = (intpart / 10);
- } while (intpart && (iplace < sizeof iconvert));
+ } while (intpart && (iplace < (int)sizeof(iconvert)));
if (iplace == sizeof iconvert)
iplace--;
iconvert[iplace] = 0;
OpenPOWER on IntegriCloud