summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/b_print.c')
-rw-r--r--src/lib/libcrypto/bio/b_print.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c
index 2fffcfc025..143a7cfefa 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#if HAVE_LONG_LONG 118#ifdef HAVE_LONG_LONG
119# if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__) 119# if defined(_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,7 +808,6 @@ 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.
812 * This function has nothing to do with BIOs, but it's closely related 811 * This function has nothing to do with BIOs, but it's closely related
813 * to BIO_printf, and we need *some* name prefix ... 812 * to BIO_printf, and we need *some* name prefix ...
814 * (XXX the function should be renamed, but to what?) */ 813 * (XXX the function should be renamed, but to what?) */
@@ -833,10 +832,10 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
833 _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); 832 _dopr(&buf, NULL, &n, &retlen, &truncated, format, args);
834 833
835 if (truncated) 834 if (truncated)
836 /* In case of truncation, return -1 unlike traditional snprintf. 835 /* In case of truncation, return -1 like traditional snprintf.
837 * (Current drafts for ISO/IEC 9899 say snprintf should return 836 * (Current drafts for ISO/IEC 9899 say snprintf should return
838 * the number of characters that would have been written, 837 * the number of characters that would have been written,
839 * had the buffer been large enough, as it did historically.) */ 838 * had the buffer been large enough.) */
840 return -1; 839 return -1;
841 else 840 else
842 return (retlen <= INT_MAX) ? (int)retlen : -1; 841 return (retlen <= INT_MAX) ? (int)retlen : -1;