diff options
Diffstat (limited to 'src/lib/libcrypto/bio/b_print.c')
-rw-r--r-- | src/lib/libcrypto/bio/b_print.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c index 143a7cfefa..2fffcfc025 100644 --- a/src/lib/libcrypto/bio/b_print.c +++ b/src/lib/libcrypto/bio/b_print.c | |||
@@ -115,8 +115,8 @@ | |||
115 | #define LDOUBLE double | 115 | #define LDOUBLE double |
116 | #endif | 116 | #endif |
117 | 117 | ||
118 | #ifdef HAVE_LONG_LONG | 118 | #if HAVE_LONG_LONG |
119 | # if defined(_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 |
@@ -808,6 +808,7 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args) | |||
808 | } | 808 | } |
809 | 809 | ||
810 | /* As snprintf is not available everywhere, we provide our own implementation. | 810 | /* As snprintf is not available everywhere, we provide our own implementation. |
811 | * In case of overflow or error, this returns -1. | ||
811 | * This function has nothing to do with BIOs, but it's closely related | 812 | * This function has nothing to do with BIOs, but it's closely related |
812 | * to BIO_printf, and we need *some* name prefix ... | 813 | * to BIO_printf, and we need *some* name prefix ... |
813 | * (XXX the function should be renamed, but to what?) */ | 814 | * (XXX the function should be renamed, but to what?) */ |
@@ -832,10 +833,10 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) | |||
832 | _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); | 833 | _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); |
833 | 834 | ||
834 | if (truncated) | 835 | if (truncated) |
835 | /* In case of truncation, return -1 like traditional snprintf. | 836 | /* In case of truncation, return -1 unlike traditional snprintf. |
836 | * (Current drafts for ISO/IEC 9899 say snprintf should return | 837 | * (Current drafts for ISO/IEC 9899 say snprintf should return |
837 | * the number of characters that would have been written, | 838 | * the number of characters that would have been written, |
838 | * had the buffer been large enough.) */ | 839 | * had the buffer been large enough, as it did historically.) */ |
839 | return -1; | 840 | return -1; |
840 | else | 841 | else |
841 | return (retlen <= INT_MAX) ? (int)retlen : -1; | 842 | return (retlen <= INT_MAX) ? (int)retlen : -1; |