mode = S_IRUSR | S_IRGRP | S_IROTH;
if (opts.create_writeable)
mode |= S_IWUSR | S_IWGRP | S_IWOTH;
- fd = open (handle_get_filename (fh), O_WRONLY | O_CREAT | O_TRUNC, mode);
+ fd = open (fh_get_filename (fh), O_WRONLY | O_CREAT | O_TRUNC, mode);
if (fd < 0)
goto open_error;
w->x = w->y = NULL;
w->var_cnt = dict_get_var_cnt (d);
- w->vars = xmalloc (sizeof *w->vars * w->var_cnt);
+ w->vars = xnmalloc (w->var_cnt, sizeof *w->vars);
for (i = 0; i < w->var_cnt; i++)
{
const struct variable *dv = dict_get_var (d, i);
if (w->compress)
{
- w->buf = xmalloc (sizeof *w->buf * 128);
+ w->buf = xnmalloc (128, sizeof *w->buf);
w->ptr = w->buf;
w->end = &w->buf[128];
w->x = (unsigned char *) w->ptr++;
open_error:
msg (ME, _("Error opening \"%s\" for writing as a system file: %s."),
- handle_get_filename (w->fh), strerror (errno));
+ fh_get_filename (w->fh), strerror (errno));
err_cond_fail ();
goto error;
}
*loc++ = vl->value.f;
*(unsigned char *) loc = len;
- memcpy (&((unsigned char *) loc)[1], vl->label, len);
- memset (&((unsigned char *) loc)[1 + len], ' ',
+ memcpy (&((char *) loc)[1], vl->label, len);
+ memset (&((char *) loc)[1 + len], ' ',
REM_RND_UP (len + 1, sizeof (flt64)));
loc += DIV_RND_UP (len + 1, sizeof (flt64));
}
if (fwrite (buf, nbytes, 1, w->file) != 1)
{
msg (ME, _("%s: Writing system file: %s."),
- handle_get_filename (w->fh), strerror (errno));
+ fh_get_filename (w->fh), strerror (errno));
return 0;
}
return 1;
if (fclose (w->file) == EOF)
msg (ME, _("%s: Closing system file: %s."),
- handle_get_filename (w->fh), strerror (errno));
+ fh_get_filename (w->fh), strerror (errno));
}
free (w->buf);