Re: [xml] debugging outputbuffer code in libxml
- From: Gennady Feldman <gena01 lk net>
- To: xml gnome org
- Subject: Re: [xml] debugging outputbuffer code in libxml
- Date: Sat, 01 Mar 2003 00:08:38 -0500
[clipped]
One interesting thing I noticed when debugging was in encoding.c
xmlCharEncOutFunc, or to be more specific the following code:
retry:
written = out->size - out->use;
/*
* First specific handling of in = NULL, i.e. the initialization call
*/
if (in == NULL) {
toconv = 0;
if (handler->output != NULL) {
ret = handler->output(&out->content[out->use], &written,
NULL, &toconv);
out->use += written;
out->content[out->use] = 0;
}
[clipped]
Here is a little fix that seems to fix the random garbage from appearing
in the output.
I have changed the above code to look something like:
retry:
written = out->size - out->use;
/*
* First specific handling of in = NULL, i.e. the initialization
call
*/
if (in == NULL) {
toconv = 0;
if (handler->output != NULL) {
ret = handler->output(&out->content[out->use], &written,
NULL, &toconv);
if (ret >= 0) {
out->use += written;
out->content[out->use] = 0;
}
}
P.S. There are a few more things that need to be fixed, and I hope to
have those figured out on Monday (unless I manage to somehow debug this
at home)
G.F. aka Gena01
http://www.gena01.com
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]