diff --git a/ChangeLog b/ChangeLog index 5c52e6f7f0018dd0e9853f37d78f921eb2d67950..35128a36ad462f18aa3232fbe4e030b1ba00ea0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Oct 19 17:08:08 CEST 2007 Daniel Veillard + + * 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 * src/conf.c: fix bug on negative values in virConfParseLong() diff --git a/src/Makefile.am b/src/Makefile.am index 4a250a8a17129c250b816e87fa1ae2a717f58280..e2d61645a8d43354dbd41e1742af9a70ce10e995 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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) diff --git a/src/buf.c b/src/buf.c index 192f0644011d1f2300ba6a510f56fd4c8286d71e..02523575b42fc782d3f3743f800c63161d12e10b 100644 --- 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); } /**