summaryrefslogtreecommitdiff
path: root/gfx/pdftoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/pdftoc.c')
-rw-r--r--gfx/pdftoc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gfx/pdftoc.c b/gfx/pdftoc.c
index e24edd1..efcd4b9 100644
--- a/gfx/pdftoc.c
+++ b/gfx/pdftoc.c
@@ -238,12 +238,15 @@ bool pdftoc_write(struct pdftoc *ctx, const void *data, unsigned length)
}
-void pdftoc_title(struct pdftoc *ctx, const char *title)
+void pdftoc_title(struct pdftoc *ctx, const char *fmt, ...)
{
+ va_list ap;
struct title *t;
t = alloc_type(struct title);
- t->s = stralloc(title);
+ va_start(ap, fmt);
+ alloc_vprintf(&t->s, fmt, ap);
+ va_end(ap);
*ctx->next_title = t;
t->next = NULL;
ctx->next_title = &t->next;