assert (fmt_check_output (format));
converters[format->type] (input, format, output);
- output[format->w] = '\0';
t = recode_string_pool (UTF8, encoding, output, format->w, pool);
free (output);
else
output_overflow (format, output);
}
+
+ output[format->w] = '\0';
}
/* Outputs Z format. */
*p = "}JKLMNOPQR"[*p - '0'];
}
memcpy (output, buf, format->w);
+ output[format->w] = '\0';
}
}
settings_get_output_integer_format (),
output);
}
+
+ output[format->w] = '\0';
}
/* Outputs PIB format. */
else
output_binary_integer (number, format->w,
settings_get_output_integer_format (), output);
+
+ output[format->w] = '\0';
}
/* Outputs PIBHEX format. */
output_binary_integer (number, format->w / 2, INTEGER_MSB_FIRST, tmp);
output_hex (tmp, format->w / 2, output);
}
+
}
/* Outputs RB format. */
{
double d = input->f;
memcpy (output, &d, format->w);
+
+ output[format->w] = '\0';
}
/* Outputs RBHEX format. */
char *output)
{
double d = input->f;
+
output_hex (&d, format->w / 2, output);
}
}
buf_copy_lpad (output, format->w, tmp, p - tmp, ' ');
+ output[format->w] = '\0';
return;
overflow:
};
if (input->f >= 1 && input->f < 8)
- 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);
}
+
}
/* Outputs MONTH format. */
};
if (input->f >= 1 && input->f < 13)
- 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);
}
+
}
/* Outputs A format. */
char *output)
{
memcpy (output, value_str (input, format->w), format->w);
+ output[format->w] = '\0';
}
/* Outputs AHEX format. */
assert (p == buf + format->w);
memcpy (output, buf, format->w);
+ output[format->w] = '\0';
return true;
}
}
else
output_overflow (format, output);
+
+ output[format->w] = '\0';
}
/* Formats OUTPUT as a missing value for the given FORMAT. */
}
else
output[format->w - 1] = '.';
+
+ output[format->w] = '\0';
}
/* Formats OUTPUT for overflow given FORMAT. */
output_overflow (const struct fmt_spec *format, char *output)
{
memset (output, '*', format->w);
+ output[format->w] = '\0';
}
/* Converts the integer part of NUMBER to a packed BCD number
char decimal[64];
assert (digits < sizeof decimal);
+
+ output[DIV_RND_UP (digits, 2)] = '\0';
if (number != SYSMIS
&& number >= 0.
&& number < power10 (digits)
*output++ = hex_digits[data[i] >> 4];
*output++ = hex_digits[data[i] & 15];
}
+ *output = '\0';
}