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
Fix yaz-client command args parsing broken YAZ-855
[yaz-moved-to-github.git]
/
ztest
/
read-marc.c
diff --git
a/ztest/read-marc.c
b/ztest/read-marc.c
index
7a54ddf
..
0b9dc1d
100644
(file)
--- a/
ztest/read-marc.c
+++ b/
ztest/read-marc.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/** \file
* See the file LICENSE for details.
*/
/** \file
@@
-12,6
+12,7
@@
#include <yaz/wrbuf.h>
#include <yaz/marcdisp.h>
#include <yaz/odr.h>
#include <yaz/wrbuf.h>
#include <yaz/marcdisp.h>
#include <yaz/odr.h>
+#include <yaz/log.h>
#include "ztest.h"
#include "ztest.h"
@@
-25,6
+26,7
@@
#include <sys/stat.h>
#endif
#include <sys/stat.h>
#endif
+#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@@
-1708,8
+1710,9
@@
char *dummy_xml_record(int num, ODR odr, const char *esn)
if (stat(wrbuf_cstr(w), &sbuf) == 0 &&
(file = fopen(wrbuf_cstr(w), "rb")))
{
if (stat(wrbuf_cstr(w), &sbuf) == 0 &&
(file = fopen(wrbuf_cstr(w), "rb")))
{
- buf = odr_malloc(odr, sbuf.st_size);
+ buf = odr_malloc(odr, 1 + sbuf.st_size);
fread(buf, 1, sbuf.st_size, file);
fread(buf, 1, sbuf.st_size, file);
+ buf[sbuf.st_size] = '\0';
}
if (file)
fclose(file);
}
if (file)
fclose(file);