diff options
Diffstat (limited to 'src/lib/libcrypto/bio/b_print.c')
| -rw-r--r-- | src/lib/libcrypto/bio/b_print.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c index f2bd91d5a0..2fffcfc025 100644 --- a/src/lib/libcrypto/bio/b_print.c +++ b/src/lib/libcrypto/bio/b_print.c | |||
| @@ -79,7 +79,7 @@ | |||
| 79 | #include <openssl/bn.h> /* To get BN_LLONG properly defined */ | 79 | #include <openssl/bn.h> /* To get BN_LLONG properly defined */ |
| 80 | #include <openssl/bio.h> | 80 | #include <openssl/bio.h> |
| 81 | 81 | ||
| 82 | #ifdef BN_LLONG | 82 | #if defined(BN_LLONG) || defined(SIXTY_FOUR_BIT) |
| 83 | # ifndef HAVE_LONG_LONG | 83 | # ifndef HAVE_LONG_LONG |
| 84 | # define HAVE_LONG_LONG 1 | 84 | # define HAVE_LONG_LONG 1 |
| 85 | # endif | 85 | # endif |
| @@ -117,7 +117,7 @@ | |||
| 117 | 117 | ||
| 118 | #if HAVE_LONG_LONG | 118 | #if HAVE_LONG_LONG |
| 119 | # if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__) | 119 | # if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__) |
| 120 | # define LLONG _int64 | 120 | # define LLONG __int64 |
| 121 | # else | 121 | # else |
| 122 | # define LLONG long long | 122 | # define LLONG long long |
| 123 | # endif | 123 | # endif |
| @@ -482,7 +482,7 @@ fmtint( | |||
| 482 | int flags) | 482 | int flags) |
| 483 | { | 483 | { |
| 484 | int signvalue = 0; | 484 | int signvalue = 0; |
| 485 | char *prefix = ""; | 485 | const char *prefix = ""; |
| 486 | unsigned LLONG uvalue; | 486 | unsigned LLONG uvalue; |
| 487 | char convert[DECIMAL_SIZE(value)+3]; | 487 | char convert[DECIMAL_SIZE(value)+3]; |
| 488 | int place = 0; | 488 | int place = 0; |
| @@ -513,8 +513,8 @@ fmtint( | |||
| 513 | (caps ? "0123456789ABCDEF" : "0123456789abcdef") | 513 | (caps ? "0123456789ABCDEF" : "0123456789abcdef") |
| 514 | [uvalue % (unsigned) base]; | 514 | [uvalue % (unsigned) base]; |
| 515 | uvalue = (uvalue / (unsigned) base); | 515 | uvalue = (uvalue / (unsigned) base); |
| 516 | } while (uvalue && (place < sizeof convert)); | 516 | } while (uvalue && (place < (int)sizeof(convert))); |
| 517 | if (place == sizeof convert) | 517 | if (place == sizeof(convert)) |
| 518 | place--; | 518 | place--; |
| 519 | convert[place] = 0; | 519 | convert[place] = 0; |
| 520 | 520 | ||
| @@ -619,6 +619,7 @@ fmtfp( | |||
| 619 | int caps = 0; | 619 | int caps = 0; |
| 620 | long intpart; | 620 | long intpart; |
| 621 | long fracpart; | 621 | long fracpart; |
| 622 | long max10; | ||
| 622 | 623 | ||
| 623 | if (max < 0) | 624 | if (max < 0) |
| 624 | max = 6; | 625 | max = 6; |
| @@ -639,11 +640,12 @@ fmtfp( | |||
| 639 | 640 | ||
| 640 | /* we "cheat" by converting the fractional part to integer by | 641 | /* we "cheat" by converting the fractional part to integer by |
| 641 | multiplying by a factor of 10 */ | 642 | multiplying by a factor of 10 */ |
| 642 | fracpart = roundv((pow_10(max)) * (ufvalue - intpart)); | 643 | max10 = roundv(pow_10(max)); |
| 644 | fracpart = roundv(pow_10(max) * (ufvalue - intpart)); | ||
| 643 | 645 | ||
| 644 | if (fracpart >= (long)pow_10(max)) { | 646 | if (fracpart >= max10) { |
| 645 | intpart++; | 647 | intpart++; |
| 646 | fracpart -= (long)pow_10(max); | 648 | fracpart -= max10; |
| 647 | } | 649 | } |
| 648 | 650 | ||
| 649 | /* convert integer part */ | 651 | /* convert integer part */ |
| @@ -652,7 +654,7 @@ fmtfp( | |||
| 652 | (caps ? "0123456789ABCDEF" | 654 | (caps ? "0123456789ABCDEF" |
| 653 | : "0123456789abcdef")[intpart % 10]; | 655 | : "0123456789abcdef")[intpart % 10]; |
| 654 | intpart = (intpart / 10); | 656 | intpart = (intpart / 10); |
| 655 | } while (intpart && (iplace < sizeof iconvert)); | 657 | } while (intpart && (iplace < (int)sizeof(iconvert))); |
| 656 | if (iplace == sizeof iconvert) | 658 | if (iplace == sizeof iconvert) |
| 657 | iplace--; | 659 | iplace--; |
| 658 | iconvert[iplace] = 0; | 660 | iconvert[iplace] = 0; |
