aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-06-12 20:40:03 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-06-12 20:40:03 +0000
commitdd1cdc3b229bee788074dbf929058fc3c04c3dd5 (patch)
tree38e9dedc23a672e85efd6995d5799c29a48c2933
parentd4d80670e50778349b93902dd8b4d46b7956a3a6 (diff)
downloadcflow-dd1cdc3b229bee788074dbf929058fc3c04c3dd5.tar.gz
cflow-dd1cdc3b229bee788074dbf929058fc3c04c3dd5.tar.bz2
(set_level_mark): Fix allocation condition
(output): Remove erroneous initialization of level_mark.
-rw-r--r--src/output.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/output.c b/src/output.c
index b062a9f..cec8aae 100644
--- a/src/output.c
+++ b/src/output.c
@@ -29,13 +29,13 @@ int level_mark_incr = 128; /* level_mark is expanded by this number of bytes */
int out_line = 1; /* Current output line number */
FILE *outfile; /* Output file */
static void
set_level_mark(int lev, int mark)
{
- if (lev > level_mark_size) {
+ if (lev >= level_mark_size) {
level_mark_size += level_mark_incr;
level_mark = xrealloc(level_mark, level_mark_size);
}
level_mark[lev] = mark;
}
@@ -407,13 +407,12 @@ output()
} else {
outfile = fopen(outname, "w");
if (!outfile)
error(2, errno, _("cannot open file `%s'"), outname);
}
- level_mark = xmalloc(level_mark_size);
set_level_mark(0, 0);
if (print_option & PRINT_XREF) {
xref_output();
}
if (print_option & PRINT_TREE) {
tree_output();

Return to:

Send suggestions and report system problems to the System administrator.