From e3f400194b8a6eaa8bfbed8d3d44b69b3ff2fb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Fri, 4 Sep 2020 12:05:45 +0000 Subject: 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)" ... --- sysutils/monitord/files/patch-mail.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sysutils/monitord/files/patch-mail.c') 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" -- cgit v1.2.3