+/* Copies string SRC to buffer DST, of size DST_SIZE bytes.
+ DST is truncated to DST_SIZE bytes or padded on the right with
+ spaces as needed. */
+void
+buf_copy_str_rpad (char *dst, size_t dst_size, const char *src)
+{
+ size_t src_len = strlen (src);
+ if (src_len >= dst_size)
+ memcpy (dst, src, dst_size);