* src/Makefile.am: fix tst build rule

* src/buf.c: fix virBufferContentAndFree to make sure the string is
  always 0 terminated.
Daniel
This commit is contained in:
Daniel Veillard 2007-10-19 15:09:31 +00:00
parent 24abf6c925
commit d620b00ffa
3 changed files with 10 additions and 2 deletions

View File

@ -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> Fri Oct 19 11:59:39 CEST 2007 Daniel Veillard <veillard@redhat.com>
* src/conf.c: fix bug on negative values in virConfParseLong() * src/conf.c: fix bug on negative values in virConfParseLong()

View File

@ -77,7 +77,7 @@ virsh_CFLAGS = $(COVERAGE_CFLAGS)
# target to ease building test programs # target to ease building test programs
# #
tst: tst.c 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) COVERAGE_FILES = $(CLIENT_SOURCES:%.c=libvirt_la-%.cov)

View File

@ -141,9 +141,11 @@ virBufferContentAndFree (virBufferPtr buf)
return(NULL); return(NULL);
content = buf->content; content = buf->content;
if (content != NULL)
content[buf->use] = 0;
free (buf); free (buf);
return content; return(content);
} }
/** /**