Package: bsd-mailx / 8.1.2-0.20141216cvs-2

07-Initialize-head-struct.patch Patch series | download
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
51
52
53
54
55
56
57
From: Robert Luberda <robert@debian.org>
Date: Wed, 21 Mar 2001 23:07:00 +0100
Subject: 07 Initialize head struct.

Initialize head struct and other fixes.
---
 cmd2.c    | 2 +-
 cmd3.c    | 2 ++
 collect.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmd2.c b/cmd2.c
index 53fa175..dff7876 100644
--- a/cmd2.c
+++ b/cmd2.c
@@ -171,7 +171,7 @@ save1(char *str, int mark, char *cmd, struct ignoretab *ignore)
 	else
 		disp = "[New file]";
 	if ((obuf = Fopen(file, "a")) == NULL) {
-		warn(NULL);
+		warn("fopen");
 		return(1);
 	}
 	for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) {
diff --git a/cmd3.c b/cmd3.c
index 905144b..066161c 100644
--- a/cmd3.c
+++ b/cmd3.c
@@ -195,6 +195,7 @@ _respond(msgvec)
 	struct name *np;
 	struct header head;
 
+	memset(&head, 0, sizeof(head));
 	if (msgvec[1] != 0) {
 		puts("Sorry, can't reply to multiple messages at once");
 		return(1);
@@ -603,6 +604,7 @@ _Respond(int *msgvec)
 	struct message *mp;
 	int *ap;
 	char *cp;
+	memset(&head, 0, sizeof(head));
 
 	head.h_to = NULL;
 	for (ap = msgvec; *ap != 0; ap++) {
diff --git a/collect.c b/collect.c
index a63693f..3bc16c3 100644
--- a/collect.c
+++ b/collect.c
@@ -405,7 +405,7 @@ exwrite(char *name, FILE *fp, int f)
         /* FIXME: Fopen with "w" will currently prevent writing to an existig file
            (/dev/null), for now I am not sure this would even marginally useful to allow */
 	if ((of = Fopen(name, "w")) == NULL) {
-		warn(NULL);
+		warn("fopen");
 		return(-1);
 	}
 	lc = 0;