diff options
| author | Xavi Del Campo <xavi.dcr@tutanota.com> | 2020-03-21 20:11:06 +0100 |
|---|---|---|
| committer | Xavi Del Campo <xavi.dcr@tutanota.com> | 2020-03-21 20:11:06 +0100 |
| commit | d4fc339810189a5c4646e83856d4f98d83345499 (patch) | |
| tree | 0852cc4ed870ad4bcffccd476dea5437e8326b48 /include | |
| parent | 34643b8a8d954b77d1928f39f380e3c09b05e7dc (diff) | |
Added comments to dynstr_dup()
Diffstat (limited to 'include')
| -rw-r--r-- | include/dynstr.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/dynstr.h b/include/dynstr.h index a545b81..d685985 100644 --- a/include/dynstr.h +++ b/include/dynstr.h @@ -108,6 +108,13 @@ enum dynstr_err dynstr_append(struct dynstr *d, const char *format, ...); * # DYNSTR_ERR_ALLOC if no more memory is available. * # DYNSTR_ERR_INIT if destination dynamic string was not initialized. * # DYNSTR_ERR_SRC if source dynamic string has no length or data. + * @note This function has the same effect as calling: + * @code + * dynstr_append(&dst, "%s", src.str); + * @endcode + * However, the implementation for dynstr_dup() should be faster as it + * does not rely on vsnprintf(), as opposed to dynstr_append(). If in + * doubt, always profile your code. */ enum dynstr_err dynstr_dup(struct dynstr *dst, const struct dynstr *src); |
