summaryrefslogtreecommitdiff
path: root/crypto/openssh/openbsd-compat/bsd-snprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/openbsd-compat/bsd-snprintf.c')
-rw-r--r--crypto/openssh/openbsd-compat/bsd-snprintf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/openssh/openbsd-compat/bsd-snprintf.c b/crypto/openssh/openbsd-compat/bsd-snprintf.c
index e4ba154fdb14..04651e1d438b 100644
--- a/crypto/openssh/openbsd-compat/bsd-snprintf.c
+++ b/crypto/openssh/openbsd-compat/bsd-snprintf.c
@@ -89,8 +89,6 @@
#include "includes.h"
-RCSID("$Id: bsd-snprintf.c,v 1.11 2005/12/17 11:32:04 dtucker Exp $");
-
#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
@@ -110,6 +108,11 @@ RCSID("$Id: bsd-snprintf.c,v 1.11 2005/12/17 11:32:04 dtucker Exp $");
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
#ifdef HAVE_LONG_DOUBLE
# define LDOUBLE long double
#else
@@ -161,7 +164,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format,
static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
char *value, int flags, int min, int max);
static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
- long value, int base, int min, int max, int flags);
+ LLONG value, int base, int min, int max, int flags);
static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
LDOUBLE fvalue, int min, int max, int flags);
static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
@@ -468,10 +471,10 @@ static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
- long value, int base, int min, int max, int flags)
+ LLONG value, int base, int min, int max, int flags)
{
int signvalue = 0;
- unsigned long uvalue;
+ unsigned LLONG uvalue;
char convert[20];
int place = 0;
int spadlen = 0; /* amount to space pad */