X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fascii.c;h=738526f388e2b4ba3241471faeac348133374d29;hb=e210b20bf6f405637c8c03dd280b5a4a627191b8;hp=ae3c805b956a0b18981f56956aabc187ec49f107;hpb=3417680e253b1bfc4519347ef06536378026be2a;p=pspp diff --git a/src/ascii.c b/src/ascii.c index ae3c805b95..738526f388 100644 --- a/src/ascii.c +++ b/src/ascii.c @@ -26,6 +26,7 @@ #include "alloc.h" #include "error.h" #include "filename.h" +#include "glob.h" #include "main.h" #include "misc.h" #include "output.h" @@ -195,7 +196,7 @@ static struct outp_option_info *option_info; static int ascii_open_global (struct outp_class *this UNUSED) { - option_info = xmalloc ( sizeof (struct outp_option_info ) ) ; + option_info = xmalloc (sizeof *option_info); option_info->initial = 0; option_info->options = 0; return 1; @@ -231,7 +232,7 @@ ascii_preopen_driver (struct outp_driver *this) assert (this->driver_open == 0); msg (VM (1), _("ASCII driver initializing as `%s'..."), this->name); - this->ext = x = xmalloc (sizeof (struct ascii_driver_ext)); + this->ext = x = xmalloc (sizeof *x); x->char_set = CHS_ASCII; x->headers = 1; x->page_length = 66; @@ -716,7 +717,7 @@ ascii_open_page (struct outp_driver *this) if (x->l > x->lines_cap) { - x->lines = xrealloc (x->lines, sizeof *x->lines * x->l); + x->lines = xnrealloc (x->lines, x->l, sizeof *x->lines); for (i = x->lines_cap; i < x->l; i++) { struct line *line = &x->lines[i]; @@ -746,8 +747,8 @@ expand_line (struct ascii_driver_ext *x, int i, int l) if (l > line->char_cap) { line->char_cap = l * 2; - line->chars = xrealloc (line->chars, - line->char_cap * sizeof *line->chars); + line->chars = xnrealloc (line->chars, + line->char_cap, sizeof *line->chars); } for (j = line->char_cnt; j < l; j++) line->chars[j] = ' '; @@ -1579,7 +1580,8 @@ ascii_close_page (struct outp_driver *this) { char temp[40]; - snprintf (temp, 80, _("%s - Page %d"), curdate, x->page_number); + snprintf (temp, 80, _("%s - Page %d"), get_start_date (), + x->page_number); memcpy (&s[x->w - strlen (temp)], temp, strlen (temp)); }