Re: [PATCH v4 3/4] string-list: provide `string_list_appendf()`
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- May 20, 2018, 19:12 UTC
- Message-ID
- <CA+P7+xqPnuuQpp5e7fduLgaSd+JrTn95w=Da7q=iCXUgo0QHFA@mail.gmail.com>
- In-Reply-To
- <77b025bb47869478e3eef1c3c34d379164f5d91c.1526810549.git.martin.agren@gmail.com>
On Sun, May 20, 2018 at 3:17 AM, Martin Ågren <martin.agren@gmail.com> wrote:
Show 9 quoted lines
> +/** > + * Add formatted string to the end of `list`. This function ignores > + * the value of `list->strdup_strings` and always appends a freshly > + * allocated string, so you will probably not want to use it with > + * `strdup_strings = 0`. > + */ > +struct string_list_item *string_list_appendf(struct string_list *list, > + const char *fmt, ...); > +
Would it make sense to verify that strdup_strings == 0? I guess we'd have to use die or BUG(), but that would mean that the program could crash..
I doubt this could be verified at compilation time....
Thanks, Jake