Mercurial > dovecot > core-2.3
changeset 26323:59dbe7c4c01f
lib: str - Add str_replace().
author | Stephan Bosch <stephan.bosch@dovecot.fi> |
---|---|
date | Fri, 15 Mar 2019 00:14:05 +0100 |
parents | 52892611dc33 |
children | d2bcc35ff7d2 |
files | src/lib/str.h |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/str.h Thu Mar 14 23:55:00 2019 +0100 +++ b/src/lib/str.h Fri Mar 15 00:14:05 2019 +0100 @@ -70,6 +70,12 @@ buffer_delete(str, pos, len); } +static inline void str_replace(string_t *str, size_t pos, size_t len, + const char *cstr) +{ + buffer_replace(str, pos, len, cstr, strlen(cstr)); +} + /* Truncate the string to specified length. If it's already smaller, do nothing. */ static inline void str_truncate(string_t *str, size_t len)