projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug #2352: yaz-marcdump crashes for certain record.
[yaz-moved-to-github.git]
/
src
/
snprintf.c
diff --git
a/src/snprintf.c
b/src/snprintf.c
index
fccf3b0
..
a3903ed
100644
(file)
--- a/
src/snprintf.c
+++ b/
src/snprintf.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: snprintf.c,v 1.1 2007-02-23 10:15:01 adam Exp $
*/
/**
* \file snprintf.c
*/
/**
* \file snprintf.c
@@
-15,11
+13,12
@@
void yaz_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{
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);
#else
#ifdef WIN32
- _vsnprintf(buf, size, fmt, ap);
+ _vsnprintf(buf, size-1, fmt, ap);
+ buf[size-1] = '\0';
#else
vsprintf(buf, fmt, ap);
#endif
#else
vsprintf(buf, fmt, ap);
#endif