From 732c1fae8404e9895941ffd173d0ad19fb4400e1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 6 Mar 2006 08:11:41 +0000 Subject: [PATCH] Null terminate a null-terminated string --- util/yaz-xmlquery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/yaz-xmlquery.c b/util/yaz-xmlquery.c index 6612183..12a9c47 100644 --- a/util/yaz-xmlquery.c +++ b/util/yaz-xmlquery.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: yaz-xmlquery.c,v 1.1 2006-02-23 10:40:59 adam Exp $ + * $Id: yaz-xmlquery.c,v 1.2 2006-03-06 08:11:41 adam Exp $ */ #include @@ -143,7 +143,8 @@ void xmlfiletopqf(const char *xmlfile) exit(1); } rewind(f); - xmlstr = xmalloc(sz); + xmlstr = xmalloc(sz+1); + xmlstr[sz] = '\0'; fread(xmlstr, sz, 1, f); fclose(f); -- 1.7.10.4