This simplifies the callers a bit.
fputs ("\nFootnotes:\n", csv->file);
for (size_t i = 0; i < n_footnotes; i++)
- if (f[i])
- {
- csv_output_field (csv, f[i]->marker);
- fputs (csv->separator, csv->file);
- csv_output_field (csv, f[i]->content);
- putc ('\n', csv->file);
- }
+ {
+ csv_output_field (csv, f[i]->marker);
+ fputs (csv->separator, csv->file);
+ csv_output_field (csv, f[i]->content);
+ putc ('\n', csv->file);
+ }
free (f);
}
size_t n_footnotes = table_collect_footnotes (item, &f);
for (size_t i = 0; i < n_footnotes; i++)
- if (f[i])
- {
- put_tfoot (html, t, &tfoot);
- fputs ("<SUP>", html->file);
- escape_string (html->file, f[i]->marker, strlen (f[i]->marker),
- " ", "<BR>");
- fputs ("</SUP> ", html->file);
- escape_string (html->file, f[i]->content, strlen (f[i]->content),
- " ", "<BR>");
- }
+ {
+ put_tfoot (html, t, &tfoot);
+ fputs ("<SUP>", html->file);
+ escape_string (html->file, f[i]->marker, strlen (f[i]->marker),
+ " ", "<BR>");
+ fputs ("</SUP> ", html->file);
+ escape_string (html->file, f[i]->content, strlen (f[i]->content),
+ " ", "<BR>");
+ }
free (f);
if (tfoot)
fputs ("</TD></TR></TFOOT>\n", html->file);
struct tab_table *t = tab_create (2, n_footnotes);
for (size_t i = 0; i < n_footnotes; i++)
- if (f[i])
- {
- tab_text_format (t, 0, i, TAB_LEFT, "%s.", f[i]->marker);
- tab_text (t, 1, i, TAB_LEFT, f[i]->content);
- if (f[i]->style)
- {
- tab_add_style (t, 0, i, f[i]->style);
- tab_add_style (t, 1, i, f[i]->style);
- }
- }
+ {
+ tab_text_format (t, 0, i, TAB_LEFT, "%s.", f[i]->marker);
+ tab_text (t, 1, i, TAB_LEFT, f[i]->content);
+ if (f[i]->style)
+ {
+ tab_add_style (t, 0, i, f[i]->style);
+ tab_add_style (t, 1, i, f[i]->style);
+ }
+ }
render_pager_add_table (p, &t->table, 0);
free (f);
footnotes = add_footnotes (caption->footnotes, caption->n_footnotes,
footnotes, &allocated, &n);
+ size_t n_nonnull = 0;
+ for (size_t i = 0; i < n; i++)
+ if (footnotes[i])
+ footnotes[n_nonnull++] = footnotes[i];
+
*footnotesp = footnotes;
- return n;
+ return n_nonnull;
}
\f
/* Returns a table that contains a single cell, whose contents are the