diff options
Diffstat (limited to 'vsnprintf.c')
-rw-r--r-- | vsnprintf.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/vsnprintf.c b/vsnprintf.c index 90c827f6a0..ecd5573dd5 100644 --- a/vsnprintf.c +++ b/vsnprintf.c @@ -101,23 +101,12 @@ # endif #endif -#if defined(__hpux) && !defined(__GNUC__) && !defined(__STDC__) -#define const -#endif - #if defined(sgi) #undef __const #define __const #endif /* People who don't like const sys_error */ #include <stddef.h> -#if defined(__hpux) && !defined(__GNUC__) || defined(__DECC) -#include <string.h> -#endif - -#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__) -#include <stdlib.h> -#endif #ifndef NULL #define NULL 0 @@ -166,6 +155,8 @@ struct __sbuf { * * NB: see WARNING above before changing the layout of this structure! */ +struct __suio; + typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ #if 0 @@ -178,8 +169,8 @@ typedef struct __sFILE { #if 0 size_t _lbfsize; /* 0 or -_bf._size, for inline putc */ #endif - int (*vwrite)(/* struct __sFILE*, struct __suio * */); - const char *(*vextra)(/* struct __sFILE*, size_t, void*, long*, int */); + int (*vwrite)(struct __sFILE*, struct __suio *); + const char *(*vextra)(struct __sFILE*, size_t, void*, long*, int); } FILE; @@ -249,9 +240,7 @@ BSD__sfvwrite(register FILE *fp, register struct __suio *uio) if ((len = uio->uio_resid) == 0) return (0); -#ifndef __hpux #define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif #define COPY(n) (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n)) iov = uio->uio_iov; @@ -563,7 +552,7 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap) #endif u_long MAYBE_UNUSED(ulval) = 0; /* integer arguments %[diouxX] */ #ifdef _HAVE_SANE_QUAD_ - u_quad_t MAYBE_UNUSED(uqval); /* %q integers */ + u_quad_t MAYBE_UNUSED(uqval) = 0; /* %q integers */ #endif /* _HAVE_SANE_QUAD_ */ int base; /* base for [diouxX] conversion */ int dprec; /* a copy of prec if [diouxX], 0 otherwise */ @@ -1266,8 +1255,8 @@ cvt(double value, int ndigits, int flags, char *sign, int *decpt, int ch, int *l } buf[0] = 0; /* rve - digits may be 0 */ memcpy(buf, digits, rve - digits); - xfree(digits); rve = buf + (rve - digits); + free(digits); digits = buf; if (flags & ALT) { /* Print trailing zeros */ bp = digits + ndigits; |