summaryrefslogtreecommitdiff
path: root/sysutils/monitord/files/patch-mail.c
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-09-04 12:05:45 +0000
committerStefan Eßer <se@FreeBSD.org>2020-09-04 12:05:45 +0000
commite3f400194b8a6eaa8bfbed8d3d44b69b3ff2fb96 (patch)
treee3a5102241a53eb6662f1c2e2006e6e90581ace3 /sysutils/monitord/files/patch-mail.c
parentFix build with -fno-common (diff)
Fix build with -fno-common
While here simplify the port's Makefile and fix the wrong usage of bzero and other library functions that take a buffer size: The size parameter passed was always the pointer, not the buffer pointed to, i.e. "bzero(buf, sizeof(buf)" instead of "bzero(buf, sizeof(*buf)" ...
Notes
Notes: svn path=/head/; revision=547533
Diffstat (limited to 'sysutils/monitord/files/patch-mail.c')
-rw-r--r--sysutils/monitord/files/patch-mail.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sysutils/monitord/files/patch-mail.c b/sysutils/monitord/files/patch-mail.c
index b0359e23696b..925db5613355 100644
--- a/sysutils/monitord/files/patch-mail.c
+++ b/sysutils/monitord/files/patch-mail.c
@@ -1,6 +1,23 @@
---- ./mail.c.orig Thu Aug 21 15:44:20 2003
-+++ ./mail.c Wed Mar 15 11:09:01 2006
-@@ -81,13 +81,13 @@
+--- mail.c.orig 2003-08-21 18:44:20 UTC
++++ mail.c
+@@ -47,11 +47,11 @@ int mail ( char *address, char *eserver, char *subject
+ username = (char *) malloc ( (size_t) _BUFSIZE ); // init the username buffer
+ hostname = (char *) malloc ( (size_t) _BUFSIZE ); // init the hostname buffer
+ thisname = (char *) malloc ( (size_t) _BUFSIZE ); // init the hostname buffer
+- bzero (buf, sizeof (buf) );
+- bzero (token, sizeof (token) );
+- bzero (username, sizeof (username) );
+- bzero (hostname, sizeof (hostname) );
+- bzero (thisname, sizeof (thisname) );
++ bzero (buf, sizeof (*buf) );
++ bzero (token, sizeof (*token) );
++ bzero (username, sizeof (*username) );
++ bzero (hostname, sizeof (*hostname) );
++ bzero (thisname, sizeof (*thisname) );
+
+ strncpy (buf, address, _BUFSIZE);
+ username = strtok (buf, "@");
+@@ -81,13 +81,13 @@ int mail ( char *address, char *eserver, char *subject
read (serversd, buf, _BUFSIZE);
// Set "MAIL FROM"
@@ -16,7 +33,7 @@
write(serversd, buf, strlen(buf));
read (serversd, buf, _BUFSIZE);
-@@ -97,17 +97,17 @@
+@@ -97,17 +97,17 @@ int mail ( char *address, char *eserver, char *subject
read (serversd, buf, _BUFSIZE);
// Set "FROM"