X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fdriver.c;h=fb5444ec14cb2dc76fa64fbef7dfd97f31c75e76;hb=7b98e6a43231d8bbf3ae79729b5e1ed9acd09d58;hp=8b5a66249d6a4b54e902468dc7319249110bf008;hpb=770c0535c142a0d74cf33f02940100cba9cc1a99;p=pspp diff --git a/src/output/driver.c b/src/output/driver.c index 8b5a66249d..fb5444ec14 100644 --- a/src/output/driver.c +++ b/src/output/driver.c @@ -239,9 +239,9 @@ output_submit (struct output_item *item) free (e->groups[idx]); if (idx >= 1 && idx <= 4) { - char key[6]; - snprintf (key, sizeof key, "Head%d", idx); + char *key = xasprintf ("Head%zu", idx); string_map_find_and_delete (&e->heading_vars, key); + free (key); } } else if (is_text_item (item)) @@ -252,9 +252,9 @@ output_submit (struct output_item *item) if (type == TEXT_ITEM_TITLE && e->n_groups >= 1 && e->n_groups <= 4) { - char key[6]; - snprintf (key, sizeof key, "Head%d", e->n_groups); + char *key = xasprintf ("Head%zu", e->n_groups); string_map_replace (&e->heading_vars, key, text); + free (key); } else if (type == TEXT_ITEM_PAGE_TITLE) string_map_replace (&e->heading_vars, "PageTitle", text);