[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sat, 24 Feb 2024 20:18:48 -0500 (EST) |
branch: master
commit 6fb281434a07b732ceb44764113f74cf144b3629
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 25 01:09:49 2024 +0100
* tp/Texinfo/XS/main/manipulate_tree.c (add_source_mark): correct used
sizeof. Allocate space one by one as more than one source mark in
list is uncommon.
---
ChangeLog | 6 ++++++
tp/Texinfo/XS/main/manipulate_tree.c | 7 ++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7cf876848c..6aed72a64e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-02-24 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/manipulate_tree.c (add_source_mark): correct used
+ sizeof. Allocate space one by one as more than one source mark in
+ list is uncommon.
+
2024-02-24 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.c (set_file_source_info)
diff --git a/tp/Texinfo/XS/main/manipulate_tree.c
b/tp/Texinfo/XS/main/manipulate_tree.c
index 284e78990d..e2744d7e9e 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.c
+++ b/tp/Texinfo/XS/main/manipulate_tree.c
@@ -396,9 +396,10 @@ add_source_mark (SOURCE_MARK *source_mark, ELEMENT *e)
SOURCE_MARK_LIST *s_mark_list = &(e->source_mark_list);
if (s_mark_list->number == s_mark_list->space)
{
- s_mark_list->space++; s_mark_list->space *= 1.5;
- s_mark_list->list = realloc (s_mark_list->list,
- s_mark_list->space * sizeof (SOURCE_MARK));
+ s_mark_list->space++;
+ s_mark_list->list
+ = realloc (s_mark_list->list,
+ s_mark_list->space * sizeof (SOURCE_MARK *));
if (!s_mark_list->list)
fatal ("realloc failed");
}