From: Adam Dickmeiss Date: Mon, 6 Mar 2006 08:11:41 +0000 (+0000) Subject: Null terminate a null-terminated string X-Git-Tag: YAZ.2.1.14~11 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=732c1fae8404e9895941ffd173d0ad19fb4400e1 Null terminate a null-terminated string --- 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);