X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=658858be3f6ddaca01688759c8e5dd341b1a9a63;hb=ebf3b993687a25782fe72f45bf3e72aa4bee7c95;hp=69222f5e229b60120ca49c4c1a71a39428b8c9b8;hpb=cb05567731adc7c890d3146102ff01068ba796dd;p=pspp-builds.git diff --git a/src/output/html.c b/src/output/html.c index 69222f5e..658858be 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -299,7 +299,7 @@ postopen (struct file_ext *f) html_var_tab = dict; while (-1 != getline (&buf, &buf_size, prologue_file)) { - char *buf2; + int len; if (strstr (buf, "!!!")) @@ -328,12 +328,14 @@ postopen (struct file_ext *f) } /* PORTME: Line terminator. */ - buf2 = fn_interp_vars (buf, html_get_var); - len = strlen (buf2); - fwrite (buf2, len, 1, f->file); - if (buf2[len - 1] != '\n') + struct string line; + ds_create(&line, buf); + fn_interp_vars(&line, html_get_var); + len = ds_length(&line); + fwrite (ds_c_str(&line), len, 1, f->file); + if (ds_c_str(&line)[len - 1] != '\n') putc ('\n', f->file); - free (buf2); + ds_destroy(&line); } if (ferror (f->file)) msg (IE, _("Reading `%s': %s."), prologue_fn, strerror (errno));