]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/Makefile.am: fix tst build rule
authorDaniel Veillard <veillard@redhat.com>
Fri, 19 Oct 2007 15:09:31 +0000 (15:09 +0000)
committerDaniel Veillard <veillard@redhat.com>
Fri, 19 Oct 2007 15:09:31 +0000 (15:09 +0000)
* src/buf.c: fix virBufferContentAndFree to make sure the string is
  always 0 terminated.
Daniel

ChangeLog
src/Makefile.am
src/buf.c

index 5c52e6f7f0018dd0e9853f37d78f921eb2d67950..35128a36ad462f18aa3232fbe4e030b1ba00ea0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Oct 19 17:08:08 CEST 2007 Daniel Veillard <veillard@redhat.com>
+
+       * src/Makefile.am: fix tst build rule
+       * src/buf.c: fix virBufferContentAndFree to make sure the string is
+         always 0 terminated.
+
 Fri Oct 19 11:59:39 CEST 2007 Daniel Veillard <veillard@redhat.com>
 
        * src/conf.c: fix bug on negative values in virConfParseLong()
index 4a250a8a17129c250b816e87fa1ae2a717f58280..e2d61645a8d43354dbd41e1742af9a70ce10e995 100644 (file)
@@ -77,7 +77,7 @@ virsh_CFLAGS = $(COVERAGE_CFLAGS)
 # target to ease building test programs
 #
 tst: tst.c
-       $(CC) $(CFLAGS) -I../include -o tst tst.c .libs/libvirt.a -lxml2 -lxenstore -lpthread
+       $(CC) $(CFLAGS) $(INCLUDES) -I../include -o tst tst.c .libs/libvirt.a -lxml2 -lxenstore -lpthread
 
 COVERAGE_FILES = $(CLIENT_SOURCES:%.c=libvirt_la-%.cov)
 
index 192f0644011d1f2300ba6a510f56fd4c8286d71e..02523575b42fc782d3f3743f800c63161d12e10b 100644 (file)
--- a/src/buf.c
+++ b/src/buf.c
@@ -141,9 +141,11 @@ virBufferContentAndFree (virBufferPtr buf)
         return(NULL);
 
     content = buf->content;
+    if (content != NULL)
+        content[buf->use] = 0;
 
     free (buf);
-    return content;
+    return(content);
 }
 
 /**