test results mc.hlp.it 156+ M
Pavel Roskin
proski at gnu.org
Mon Jan 20 23:20:04 UTC 2003
Hello!
> Attached is ^^^ mchlp. I posted it on an ftp server
> with anon access if email attachment is problematic:
> ftp://ftp.w-color.com/pub/mc/mchlp.gz
> I'm online now (Mon Jan 20 15:41:11 EST 2003)
> if I can help in any way let me know (maybe a
> different slice of the file or something...)
Just a description of what's inside:
2851 newlines.
Table of contents, just like the one in the beginning of the
correct help files. However, the last entry is the license (Licenza).
The QueryBox and "How to use help" entries are missing. Instead of that,
the rest of the file is filled with spaces.
Looking at the code, this seems to be the culprit:
fprintf (f_out, " %*s\001%s\002%s\003", cnode->heading_level,
"", cnode->lname ? cnode->lname : node, node);
This is used to print the table of contents. If cnode->heading_level is
negative, some stupid versions of fprintf may try to print an infinite
number of spaces.
Now the question is how cnode->heading_level becomes negative. It's never
assigned a negative value. However, it doesn't seem to be initialized
when the template is being processed. This patch should help:
=======================
--- man2hlp.c
+++ man2hlp.c
@@ -773,6 +773,7 @@ main (int argc, char **argv)
cnode->node[p - node - 2] = 0;
cnode->lname = NULL;
cnode->next = NULL;
+ cnode->heading_level = 0;
}
} else
node = NULL;
=======================
Testing under valgrind confirms that there are uses of uninitialized
values, which go away after applying this patch! I'm applying it to CVS.
My request sent in private remains in force - I'd like to have a chance to
check possible warnings. Also the weird newlines in the beginning remain
unexplained, although it may be a side effect of fprintf going crazy.
--
Regards,
Pavel Roskin
More information about the mc-devel
mailing list