summaryrefslogtreecommitdiffstats
path: root/src/basic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:09:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:09:07 +0000
commit7257648854d395257843e449a0763c31150c48b9 (patch)
tree822bdd281c8b364c220c9bebc3812aa2274008ff /src/basic
parentAdding debian version 256-2. (diff)
downloadsystemd-7257648854d395257843e449a0763c31150c48b9.tar.xz
systemd-7257648854d395257843e449a0763c31150c48b9.zip
Merging upstream version 256.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/strbuf.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
index 0617acc..6d43955 100644
--- a/src/basic/strbuf.c
+++ b/src/basic/strbuf.c
@@ -107,7 +107,6 @@ static void bubbleinsert(struct strbuf_node *node,
/* add string, return the index/offset into the buffer */
ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len) {
uint8_t c;
- char *buf_new;
struct strbuf_child_entry *child;
struct strbuf_node *node;
ssize_t off;
@@ -147,10 +146,8 @@ ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len) {
}
/* add new string */
- buf_new = realloc(str->buf, str->len + len+1);
- if (!buf_new)
+ if (!GREEDY_REALLOC(str->buf, str->len + len + 1))
return -ENOMEM;
- str->buf = buf_new;
off = str->len;
memcpy(str->buf + off, s, len);
str->len += len;