X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Ffile-type.c;h=ff97f8dbbfbfd868c7adcd72c10672fb3a32bf1b;hb=5c5204d433be6419112bd77f75b9a9adb642f766;hp=6a706eec5c2d5a01412d007773450796e858f459;hpb=119676ae19d4f862cab6261936d1f6223f5534cc;p=pspp diff --git a/src/file-type.c b/src/file-type.c index 6a706eec5c..ff97f8dbbf 100644 --- a/src/file-type.c +++ b/src/file-type.c @@ -33,6 +33,9 @@ #include "var.h" #include "vfm.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + /* Defines the three types of complex files read by FILE TYPE. */ enum { @@ -71,8 +74,7 @@ struct record_type int ft, lt; /* First, last transformation index. */ }; /* record_type */ -/* Represents a FILE TYPE input program. Does not contain a - trns_header because it's never submitted as a transformation. */ +/* Represents a FILE TYPE input program. */ struct file_type_pgm { int type; /* One of the FTY_* constants. */ @@ -442,7 +444,7 @@ cmd_record_type (void) if (rct->nv >= mv) { mv += 16; - rct->v = xrealloc (rct->v, mv * sizeof *rct->v); + rct->v = xnrealloc (rct->v, mv, sizeof *rct->v); } if (formats[fty->record.fmt].cat & FCAT_STRING) @@ -450,8 +452,8 @@ cmd_record_type (void) if (!lex_force_string ()) goto error; rct->v[rct->nv].c = xmalloc (fty->record.nc + 1); - st_bare_pad_copy (rct->v[rct->nv].c, ds_c_str (&tokstr), - fty->record.nc + 1); + buf_copy_str_rpad (rct->v[rct->nv].c, fty->record.nc + 1, + ds_c_str (&tokstr)); } else {