/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/**
* \file snprintf.c
* \brief snprintf wrapper
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
#include <stdarg.h>
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