From ce45129b5b4dbee7c81b4a4d5475d442e097d5ec Mon Sep 17 00:00:00 2001 From: billiob Date: Tue, 4 Oct 2011 20:47:15 +0000 Subject: [PATCH] eina: eina_strbuf_append_length(sb, s, 0) is possible also fix typo in doc, remove a trailing space and myself to authors git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@63811 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- AUTHORS | 1 + src/include/eina_strbuf.h | 4 ++-- src/lib/eina_strbuf_common.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 170169b..354de52 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,3 +18,4 @@ Tom Hacohen Sebastian Dransfeld Myungjae Lee Youness Alaoui +billiob (Boris Faure) diff --git a/src/include/eina_strbuf.h b/src/include/eina_strbuf.h index d4f6b34..0915023 100644 --- a/src/include/eina_strbuf.h +++ b/src/include/eina_strbuf.h @@ -183,7 +183,7 @@ EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf, const char *str, size_t ma * This function appends @p str to @p buf. @p str must be of size at * most @p length. It is slightly faster than eina_strbuf_append() as * it does not compute the size of @p str. It is useful when dealing - * with strings of known size, such as eina_strngshare. If @p buf + * with strings of known size, such as eina_stringshare. If @p buf * can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is * returned. * @@ -191,7 +191,7 @@ EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf, const char *str, size_t ma * @see eina_strbuf_append() * @see eina_strbuf_append_n() */ -EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf, const char *str, size_t length) EINA_ARG_NONNULL(1, 2); +EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf, const char *str, size_t length) EINA_ARG_NONNULL(1); /** * @brief Append a character to a string buffer, reallocating as diff --git a/src/lib/eina_strbuf_common.c b/src/lib/eina_strbuf_common.c index abdd57c..46067cd 100644 --- a/src/lib/eina_strbuf_common.c +++ b/src/lib/eina_strbuf_common.c @@ -447,7 +447,7 @@ eina_strbuf_common_append_length(size_t csize, if (EINA_UNLIKELY(!_eina_strbuf_common_grow(csize, buf, buf->len + length))) return EINA_FALSE; - memcpy(((unsigned char *)(buf->buf)) + (buf->len * csize), str, + memcpy(((unsigned char *)(buf->buf)) + (buf->len * csize), str, length * csize); buf->len += length; memset(((unsigned char *)(buf->buf)) + (buf->len * csize), 0, csize); -- 2.7.4