summaryrefslogtreecommitdiff
path: root/cvs-fast-export/0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch
blob: 1e71c117c851664c3a74289f53ca3cc9536fbcf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From f0c3155affc1f3242677b2107431a55cc706805a Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond" <esr@thyrsus.com>
Date: Tue, 15 Oct 2024 14:26:32 -0400
Subject: [PATCH 4/4] Address GitLab bug #70: xmalloc/xcalloc bad parameter
 sizes...

...seize compilation with -Werror (default).
---
 generate.c | 2 +-
 treepack.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/generate.c b/generate.c
index 3cf7bd6..cd3994a 100644
--- a/generate.c
+++ b/generate.c
@@ -1066,7 +1066,7 @@ static node_t *generate_setup(generator_t *gen) {
 		eb->Gfilename = gen->master_name;
 		eb->Gexpand = gen->expand;
 		eb->Gabspath = NULL;
-		Gline(eb) = xmalloc(0, __func__);
+		Gline(eb) = NULL;
 		Ggap(eb) = Ggapsize(eb) = Glinemax(eb) = 0;
 	}
 
diff --git a/treepack.c b/treepack.c
index b385460..06d6d2f 100644
--- a/treepack.c
+++ b/treepack.c
@@ -210,7 +210,7 @@ void revdir_pack_init(void) {
 	frame = frames;
 	nfiles = 0;
 	frames[0].dir = root_dir;
-	frames[0].dirs = xmalloc(0, __func__);
+	frames[0].dirs = NULL;
 	frames[0].ndirs = 0;
 	frame->sdirs = 0;
 	frames[0].hash = hash_init();
@@ -255,7 +255,7 @@ void revdir_pack_add(const cvs_commit *file, const master_dir *dir) {
 
 			const master_dir *parent = frame++->dir;
 			frame->dir = first_subdir(dir, parent);
-			frame->dirs = xmalloc(0, __func__);
+			frame->dirs = NULL;
 			frame->ndirs = 0;
 			frame->sdirs = 0;
 			frame->hash = hash_init();
-- 
2.47.1