aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-11-26 20:06:03 +0800
committerpeter <peter@FreeBSD.org>2000-11-26 20:06:03 +0800
commitf20e3c4dcf73512ea314149173e9c38cea443331 (patch)
tree65097f41c163cc14cef1cda0173062b35c79df33 /CVSROOT
parentb9a7f63211e02cac0915702662a893feec55a423 (diff)
downloadfreebsd-ports-gnome-f20e3c4dcf73512ea314149173e9c38cea443331.tar.gz
freebsd-ports-gnome-f20e3c4dcf73512ea314149173e9c38cea443331.tar.zst
freebsd-ports-gnome-f20e3c4dcf73512ea314149173e9c38cea443331.zip
Tidy up some bogus stuff.
Reviewed by: kris
Diffstat (limited to 'CVSROOT')
-rw-r--r--CVSROOT/mailsend.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/CVSROOT/mailsend.c b/CVSROOT/mailsend.c
index b057f621f9c0..9cadc1dc5c7b 100644
--- a/CVSROOT/mailsend.c
+++ b/CVSROOT/mailsend.c
@@ -72,7 +72,6 @@ makerfc822date(time_t now)
static char buf[1024];
time_t tzo;
-#ifdef BSD
tm = localtime(&now);
tzo = tm->tm_gmtoff;
@@ -91,27 +90,6 @@ makerfc822date(time_t now)
tzo,
tm->tm_zone
);
-#else
- tzset();
- tm = localtime(&now);
-
- tzo = - (tm->tm_isdst <= 0 ? timezone : altzone);
-
- tzo = tzo / 60; /* minutes */
- tzo = (tzo % 60) + (tzo / 60 * 100);
-
- snprintf(buf, sizeof(buf), "%s, %d %s %d %02d:%02d:%02d +%04d (%s)",
- wday[tm->tm_wday],
- tm->tm_mday,
- mon[tm->tm_mon],
- tm->tm_year + 1900,
- tm->tm_hour,
- tm->tm_min,
- tm->tm_sec,
- tzo,
- tm->tm_isdst <= 0 ? tzname[0] : tzname[1]
- );
-#endif
return buf;
}
@@ -128,6 +106,7 @@ main(int ac, char **av)
char buf[1024];
char Frombuf[256]; /* Long enough */
char frombuf[256]; /* Long enough */
+ char gecos[256]; /* Long enough */
char *s;
char *subj = NULL;
@@ -243,11 +222,17 @@ main(int ac, char **av)
}
if (pw && hostname == buf) {
if (pw->pw_gecos) {
- if ((s = strchr(pw->pw_gecos, ',')))
+ strncpy(gecos, pw->pw_gecos, sizeof(gecos) - 1);
+ gecos[sizeof(gecos) - 1] = '\0';
+ if ((s = strchr(gecos, ',')))
*s = '\0';
- if ((s = strchr(pw->pw_gecos, ';')))
+ if ((s = strchr(gecos, ';')))
*s = '\0';
- snprintf(Frombuf, sizeof(Frombuf), "%s <%s@%s>", pw->pw_gecos, pw->pw_name, hostname);
+#ifdef EVIL
+ if (strcmp(gecos, "Alfred Perlstein") == 0)
+ strcpy(gecos, "Albert Perlstein");
+#endif
+ snprintf(Frombuf, sizeof(Frombuf), "%s <%s@%s>", gecos, pw->pw_name, hostname);
} else {
snprintf(Frombuf, sizeof(Frombuf), "%s@%s", pw->pw_name, hostname); /* From@hostname */
}