prefix.prefix_idx = prefix_idx;
array_append(&prefix_stack, &prefix, 1);
- str_append_n(ctx->list_prefix, indent_str, indent*2);
+ str_append_max(ctx->list_prefix, indent_str, indent*2);
p = strchr(key2, '/');
if (p != NULL)
str_append_data(ctx->list_prefix, key2, p - key2);
}
if (filter->local_name != NULL) {
- str_append_n(str, indent_str, indent*2);
+ str_append_max(str, indent_str, indent*2);
str_printfa(str, "local_name %s {\n", filter->local_name);
indent++;
}
if (filter->remote_bits > 0) {
- str_append_n(str, indent_str, indent*2);
+ str_append_max(str, indent_str, indent*2);
str_printfa(str, "remote %s", net_ip2addr(&filter->remote_net));
if (IPADDR_IS_V4(&filter->remote_net)) {
indent++;
}
if (filter->service != NULL) {
- str_append_n(str, indent_str, indent*2);
+ str_append_max(str, indent_str, indent*2);
str_printfa(str, "protocol %s {\n", filter->service);
indent++;
}
if (max_prefix_len > (size_t)(p - node->name))
max_prefix_len = p - node->name;
}
- str_append_n(&buf, node->name, max_prefix_len);
+ str_append_max(&buf, node->name, max_prefix_len);
str_append_c(&buf, '-');
prefix_len = buf.used;
max_prefix_len = TEMP_MAX_NAME_LEN - strlen(new_suffix) - 1;
if (max_prefix_len > (size_t)(p-node->name))
max_prefix_len = p-node->name;
- str_append_n(str, node->name, max_prefix_len);
+ str_append_max(str, node->name, max_prefix_len);
str_append(str, new_suffix);
while (node_has_child(node->parent, str_c(str)))
suffix_inc(str);
while (pos < str_len(full_str)) {
str_truncate(str, prefix_len);
- str_append_n(str, str_c(full_str) + pos, max_text_len);
+ str_append_max(str, str_c(full_str) + pos, max_text_len);
str_append_c(str, '\n');
if (log_fd_write(STDERR_FILENO,
str_data(str), str_len(str)) < 0)
else if (!ctx.zero_padding) {
if (ctx.width < 0)
ctx.width = strlen(var) - (-ctx.width);
- str_append_n(dest, var, ctx.width);
+ str_append_max(dest, var, ctx.width);
} else {
/* %05d -like padding. no truncation. */
ssize_t len = strlen(var);