-/*
- * Copyright (C) 2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) Index Data
* See the file LICENSE for details.
- *
- * $Id: snprintf.c,v 1.1 2007-02-23 10:15:01 adam Exp $
*/
/**
* \file snprintf.c
* \brief snprintf wrapper
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
#include <stdarg.h>
void yaz_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{
-#if HAVE_VSNPRINF
+#if HAVE_VSNPRINTF
vsnprintf(buf, size, fmt, ap);
#else
#ifdef WIN32
- _vsnprintf(buf, size, fmt, ap);
+ _vsnprintf(buf, size-1, fmt, ap);
+ buf[size-1] = '\0';
#else
vsprintf(buf, fmt, ap);
#endif
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab