summaryrefslogtreecommitdiff
path: root/source3/lib/snprintf.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-05-14 01:14:06 +0000
committerTim Potter <tpot@samba.org>2003-05-14 01:14:06 +0000
commit65bc416e6590df8808f9eaf5c1f65186c57130b1 (patch)
tree49db77c2731f63c79570e2b81993fcf07435b8ec /source3/lib/snprintf.c
parente25e8fac4defd53b14da2d2e4a974ab050b6e0d4 (diff)
downloadsamba-65bc416e6590df8808f9eaf5c1f65186c57130b1.tar.gz
samba-65bc416e6590df8808f9eaf5c1f65186c57130b1.tar.bz2
samba-65bc416e6590df8808f9eaf5c1f65186c57130b1.zip
Move some #ifdefs and function prototypes around to avoid a compiler
warning when we have a working version of snprintf() (This used to be commit 080a943e24f1dd02ebdf31ec3e76a1c3d19834df)
Diffstat (limited to 'source3/lib/snprintf.c')
-rw-r--r--source3/lib/snprintf.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c
index 4aef82c7d8..062521e726 100644
--- a/source3/lib/snprintf.c
+++ b/source3/lib/snprintf.c
@@ -152,16 +152,6 @@
#define VA_COPY(dest, src) (dest) = (src)
#endif
-static size_t dopr(char *buffer, size_t maxlen, const char *format,
- va_list args_in);
-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);
-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);
-
/*
* dopr(): poor man's version of doprintf
*/
@@ -196,6 +186,19 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
#endif
+/* yes this really must be a ||. Don't muck with this (tridge) */
+#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+
+static size_t dopr(char *buffer, size_t maxlen, const char *format,
+ va_list args_in);
+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);
+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);
+
static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args_in)
{
char ch;
@@ -810,15 +813,13 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c)
(*currlen)++;
}
-/* yes this really must be a ||. Don't muck with this (tridge) */
-#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
{
return dopr(str, count, fmt, args);
}
#endif
-/* yes this really must be a ||. Don't muck wiith this (tridge)
+/* yes this really must be a ||. Don't muck with this (tridge)
*
* The logic for these two is that we need our own definition if the
* OS *either* has no definition of *sprintf, or if it does have one