summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_strbuf_common.c
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-06-22 17:16:34 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-06-22 17:16:34 +0900
commit8f3be603c201c0785e234f9836cd98bad1b2279e (patch)
tree827eefb469fe36321d5806568e62ba2bf67586de /src/lib/eina/eina_strbuf_common.c
parent1a2811bae4087a1d6078c93c45043c597f256114 (diff)
eina_strbuf: if readonly strbuf is malloc, then it will stop being readonly
Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision: https://phab.enlightenment.org/D11992
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_strbuf_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/eina/eina_strbuf_common.c b/src/lib/eina/eina_strbuf_common.c
index ebec119c2a..b4d3427a39 100644
--- a/src/lib/eina/eina_strbuf_common.c
+++ b/src/lib/eina/eina_strbuf_common.c
@@ -757,6 +757,7 @@ eina_strbuf_common_remove(size_t csize,
757 if (!dest) return 0; 757 if (!dest) return 0;
758 memcpy(dest, buf->buf, buf->len); 758 memcpy(dest, buf->buf, buf->len);
759 buf->buf = dest; 759 buf->buf = dest;
760 buf->ro = EINA_FALSE;
760 } 761 }
761 762
762 remove_len = end - start; 763 remove_len = end - start;
@@ -825,6 +826,7 @@ eina_strbuf_common_string_steal(size_t csize, Eina_Strbuf *buf)
825 if (!dest) return 0; 826 if (!dest) return 0;
826 memcpy(dest, buf->buf, buf->len); 827 memcpy(dest, buf->buf, buf->len);
827 buf->buf = dest; 828 buf->buf = dest;
829 buf->ro = EINA_FALSE;
828 } 830 }
829 831
830 ret = buf->buf; 832 ret = buf->buf;
@@ -958,6 +960,7 @@ eina_strbuf_replace(Eina_Strbuf *buf,
958 if (!dest) return 0; 960 if (!dest) return 0;
959 memcpy(dest, buf->buf, buf->len); 961 memcpy(dest, buf->buf, buf->len);
960 buf->buf = dest; 962 buf->buf = dest;
963 buf->ro = EINA_FALSE;
961 } 964 }
962 965
963 if (len1 != len2) 966 if (len1 != len2)
@@ -1003,6 +1006,7 @@ eina_strbuf_replace_all(Eina_Strbuf *buf, const char *str, const char *with)
1003 if (!dest) return 0; 1006 if (!dest) return 0;
1004 memcpy(dest, buf->buf, buf->len); 1007 memcpy(dest, buf->buf, buf->len);
1005 buf->buf = dest; 1008 buf->buf = dest;
1009 buf->ro = EINA_FALSE;
1006 } 1010 }
1007 1011
1008 len1 = strlen(str); 1012 len1 = strlen(str);