- Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
assert (fmt_check_output (format));
converters[format->type] (input, format, output);
assert (fmt_check_output (format));
converters[format->type] (input, format, output);
- char *s = recode_string (encoding, LEGACY_NATIVE, output, format->w );
+ char *s = recode_string (encoding, C_ENCODING, output, format->w );
data_out_pool (const union value *input, const char *encoding,
const struct fmt_spec *format, struct pool *pool)
{
data_out_pool (const union value *input, const char *encoding,
const struct fmt_spec *format, struct pool *pool)
{
t = recode_string_pool (UTF8, encoding, output, format->w, pool);
free (output);
t = recode_string_pool (UTF8, encoding, output, format->w, pool);
free (output);
*p = "}JKLMNOPQR"[*p - '0'];
}
memcpy (output, buf, format->w);
*p = "}JKLMNOPQR"[*p - '0'];
}
memcpy (output, buf, format->w);
else
output_binary_integer (number, format->w,
settings_get_output_integer_format (), output);
else
output_binary_integer (number, format->w,
settings_get_output_integer_format (), output);
output_binary_integer (number, format->w / 2, INTEGER_MSB_FIRST, tmp);
output_hex (tmp, format->w / 2, output);
}
output_binary_integer (number, format->w / 2, INTEGER_MSB_FIRST, tmp);
output_hex (tmp, format->w / 2, output);
}
}
buf_copy_lpad (output, format->w, tmp, p - tmp, ' ');
}
buf_copy_lpad (output, format->w, tmp, p - tmp, ' ');
- buf_copy_str_rpad (output, format->w, weekdays[(int) input->f - 1], ' ');
+ {
+ buf_copy_str_rpad (output, format->w,
+ weekdays[(int) input->f - 1], ' ');
+ output[format->w] = '\0';
+ }
else
{
if (input->f != SYSMIS)
msg (ME, _("Weekday number %f is not between 1 and 7."), input->f);
output_missing (format, output);
}
else
{
if (input->f != SYSMIS)
msg (ME, _("Weekday number %f is not between 1 and 7."), input->f);
output_missing (format, output);
}
- buf_copy_str_rpad (output, format->w, months[(int) input->f - 1], ' ');
+ {
+ buf_copy_str_rpad (output, format->w, months[(int) input->f - 1], ' ');
+ output[format->w] = '\0';
+ }
else
{
if (input->f != SYSMIS)
msg (ME, _("Month number %f is not between 1 and 12."), input->f);
output_missing (format, output);
}
else
{
if (input->f != SYSMIS)
msg (ME, _("Month number %f is not between 1 and 12."), input->f);
output_missing (format, output);
}
char *output)
{
memcpy (output, value_str (input, format->w), format->w);
char *output)
{
memcpy (output, value_str (input, format->w), format->w);
the negative suffix, plus (if negative) the negative
prefix. */
width = rounder_width (r, decimals, &integer_digits, &add_neg_prefix);
the negative suffix, plus (if negative) the negative
prefix. */
width = rounder_width (r, decimals, &integer_digits, &add_neg_prefix);
- p = mempcpy (p, ss_data (style->neg_prefix),
- ss_length (style->neg_prefix));
+ p = stpcpy (p, style->neg_prefix.s);
- p = mempcpy (p, ss_data (style->neg_suffix),
- ss_length (style->neg_suffix));
+ p = stpcpy (p, style->neg_suffix.s);
- p = mempcpy (p, ss_data (style->neg_prefix),
- ss_length (style->neg_prefix));
+ p = stpcpy (p, style->neg_prefix.s);
if (fraction_width > 0)
sprintf (p, "%#.*E", fraction_width - 1, fabs (number));
else
if (fraction_width > 0)
sprintf (p, "%#.*E", fraction_width - 1, fabs (number));
else
- p = mempcpy (p, ss_data (style->neg_suffix),
- ss_length (style->neg_suffix));
+ p = stpcpy (p, style->neg_suffix.s);
assert (p == buf + format->w);
memcpy (output, buf, format->w);
assert (p == buf + format->w);
memcpy (output, buf, format->w);
output_overflow (const struct fmt_spec *format, char *output)
{
memset (output, '*', format->w);
output_overflow (const struct fmt_spec *format, char *output)
{
memset (output, '*', format->w);