[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 10 Nov 2023 17:30:41 -0500 (EST) |
branch: master
commit 6e8b6ef19573551ea86994e3500ede1e080dcc0f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Nov 10 22:12:32 2023 +0100
* tp/Texinfo/XS/convert/indices_in_conversion.c (merge_indices): add a
trailing zeroed merged index index entry.
---
ChangeLog | 5 +++++
tp/Texinfo/XS/convert/indices_in_conversion.c | 7 ++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 13dca9db30..80ada889c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-11-10 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/indices_in_conversion.c (merge_indices): add a
+ trailing zeroed merged index index entry.
+
2023-11-10 Gavin Smith <gavinsmith0123@gmail.com>
* util/texi2dvi (move_to_dest): When --output is given, report
diff --git a/tp/Texinfo/XS/convert/indices_in_conversion.c
b/tp/Texinfo/XS/convert/indices_in_conversion.c
index cf05deb0ba..122548796d 100644
--- a/tp/Texinfo/XS/convert/indices_in_conversion.c
+++ b/tp/Texinfo/XS/convert/indices_in_conversion.c
@@ -63,7 +63,7 @@ merge_indices (INDEX **index_names)
}
}
if (!merged_idx)
- /* main index (possibly itself) not already setup, do it */
+ /* main index (possibly idx) not already setup, do it */
{
if (merged_indices_number == merged_indices_space)
{
@@ -94,9 +94,10 @@ merge_indices (INDEX **index_names)
}
}
}
- /* shrink memory to used memory, up to merged_indices_number */
+ /* set to the final size, including a trailing MERGED_INDEX filled with 0 */
merged_indices = realloc (merged_indices,
- merged_indices_number * sizeof (MERGED_INDEX));
+ (merged_indices_number +1) * sizeof
(MERGED_INDEX));
+ memset (&merged_indices[merged_indices_number], 0, sizeof (MERGED_INDEX));
return merged_indices;
}