texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * info/nodes.c (make_file_buffer, info_create_tag


From: Patrice Dumas
Subject: branch master updated: * info/nodes.c (make_file_buffer, info_create_tag, info_create_node): initialize with memset call zeroing the structure.
Date: Sun, 13 Oct 2024 06:18:38 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new b2e060c8f3 * info/nodes.c (make_file_buffer, info_create_tag, 
info_create_node): initialize with memset call zeroing the structure.
b2e060c8f3 is described below

commit b2e060c8f3b1cb4e42e8baa6a783a6c58eaeed2e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Oct 13 12:18:30 2024 +0200

    * info/nodes.c (make_file_buffer, info_create_tag, info_create_node):
    initialize with memset call zeroing the structure.
---
 ChangeLog    |  5 +++++
 info/nodes.c | 26 ++------------------------
 2 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d61bd89755..bbc9eb451c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-13  Patrice Dumas  <pertusus@free.fr>
+
+       * info/nodes.c (make_file_buffer, info_create_tag, info_create_node):
+       initialize with memset call zeroing the structure.
+
 2024-10-13  Patrice Dumas  <pertusus@free.fr>
 
        Install texi2any codes and included js in datadir/texi2any
diff --git a/info/nodes.c b/info/nodes.c
index 2793553316..82ebe98f9a 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -820,13 +820,7 @@ make_file_buffer (void)
 {
   FILE_BUFFER *file_buffer = xmalloc (sizeof (FILE_BUFFER));
 
-  file_buffer->filename = file_buffer->fullpath = NULL;
-  file_buffer->contents = NULL;
-  file_buffer->tags = NULL;
-  file_buffer->subfiles = NULL;
-  file_buffer->tags_slots = 0;
-  file_buffer->flags = 0;
-  file_buffer->encoding = 0;
+  memset (file_buffer, 0, sizeof (FILE_BUFFER));
 
   return file_buffer;
 }
@@ -881,11 +875,6 @@ info_create_tag (void)
   TAG *t = xmalloc (sizeof (TAG));
 
   memset (t, 0, sizeof (TAG));
-  t->filename = 0;
-  t->nodename = 0;
-  t->nodestart = 0;
-  t->nodestart_adjusted = 0;
-  t->cache.nodelen = 0;
 
   return t;
 }
@@ -896,18 +885,7 @@ info_create_node (void)
 {
   NODE *n = xmalloc (sizeof (NODE));
 
-  n->fullpath = 0;
-  n->subfile = 0;
-  n->nodename = 0;
-  n->contents = 0;
-  n->nodelen = 0;
-  n->display_pos = 0;
-  n->body_start = 0;
-  n->flags = 0;
-  n->references = 0;
-  n->up = 0;
-  n->prev = 0;
-  n->next = 0;
+  memset (n, 0, sizeof (NODE));
 
   return n;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]