if (time (&t) == (time_t) -1)
{
creation_date = xstrdup ("01 Jan 70");
- creation_time = xstrdup ( "00:00:00");
+ creation_time = xstrdup ("00:00:00");
}
else
{
Missing values for long string variables are written in a separate
record. */
+ enum { MAX_SHORT_STRING = 8 };
if (width <= MAX_SHORT_STRING)
{
const struct missing_values *mv = var_get_missing_values (v);
if (mrset->width == 0)
counted = xasprintf ("%.0f", mrset->counted.f);
else
- counted = xmemdup0 (value_str (&mrset->counted, mrset->width),
- mrset->width);
+ counted = xmemdup0 (mrset->counted.s, mrset->width);
ds_put_format (&s, "%zu %s", strlen (counted), counted);
free (counted);
}
const char *encoding = dict_get_encoding (dict);
size_t n_vars = dict_get_var_cnt (dict);
size_t size, i;
- off_t start UNUSED;
/* Figure out the size in advance. */
size = 0;
write_int (w, 1); /* Data item (byte) size. */
write_int (w, size); /* Number of data items. */
- start = ftello (w->file);
for (i = 0; i < n_vars; i++)
{
struct variable *var = dict_get_var (dict, i);
size_t len;
write_int (w, width);
- write_bytes (w, value_str (val_lab_get_value (val_lab), width),
- width);
+ write_bytes (w, val_lab_get_value (val_lab)->s, width);
label = recode_string (var_get_encoding (var), "UTF-8",
val_lab_get_escaped_label (val_lab), -1);
free (label);
}
}
- assert (ftello (w->file) == start + size);
}
static void
const char *encoding = dict_get_encoding (dict);
size_t n_vars = dict_get_var_cnt (dict);
size_t size, i;
- off_t start UNUSED;
/* Figure out the size in advance. */
size = 0;
write_int (w, 1); /* Data item (byte) size. */
write_int (w, size); /* Number of data items. */
- start = ftello (w->file);
for (i = 0; i < n_vars; i++)
{
struct variable *var = dict_get_var (dict, i);
const union value *value = mv_get_value (mv, j);
write_int (w, 8);
- write_bytes (w, value_str (value, width), 8);
+ write_bytes (w, value->s, 8);
}
}
- assert (ftello (w->file) == start + size);
}
static void
write_float (w, value->f);
else
{
- write_bytes (w, value_str (value, width), width);
+ write_bytes (w, value->s, width);
write_zeros (w, 8 - width);
}
}