* Adapted by Kern Sibbald to Bacula June 2003
*/
/*
- Copyright (C) 2000-2003 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
*/
-
+#ifndef HAVE_WIN32
#include "bacula.h"
#if defined(HAVE_PCREPOSIX)
# include <pcreposix.h>
int n;
int bytes;
- if (format == NULL || ap == NULL)
+ if (format == NULL)
return -1;
bytes = 0;
while (*format != '\0') {
int n;
var_mvsnprintf_cb_t ctx;
- if (format == NULL || ap == NULL)
+ if (format == NULL)
return -1;
if (buffer != NULL && bufsize == 0)
return -1;
const char *fmt, va_list ap)
{
var_rc_t rc;
- va_list apbak;
char *cpBuf;
- int nBuf;
+ int nBuf = 5000;
/* argument sanity checks */
if (var == NULL || dst_ptr == NULL || fmt == NULL)
return VAR_RC(VAR_ERR_INVALID_ARGUMENT);
- /* determine formatting buffer length */
- apbak = ap;
- nBuf = var_mvsnprintf(NULL, 0, fmt, ap);
- ap = apbak;
- if (nBuf == -1)
- return VAR_RC(VAR_ERR_FORMATTING_FAILURE);
-
/* perform formatting */
if ((cpBuf = (char *)malloc(nBuf+1)) == NULL)
return VAR_RC(VAR_ERR_OUT_OF_MEMORY);
}
return str;
}
+#endif