diff options
author | ache <ache@FreeBSD.org> | 1997-09-24 20:17:43 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-09-24 20:17:43 +0000 |
commit | 705dab002eab94c23d00d5594774f05e26e9cf14 (patch) | |
tree | a628143dfe8011c33dfbe92554e020b7dfbb44fa /games/larn/bill.c | |
parent | 5771b3d5f6004b8173c2a09ff90b23a26c09c16c (diff) | |
download | FreeBSD-src-705dab002eab94c23d00d5594774f05e26e9cf14.zip FreeBSD-src-705dab002eab94c23d00d5594774f05e26e9cf14.tar.gz |
Headers cleanup.
Add revoke before shell exit.
Fix mail sending procedure.
Convert to random()
Implement nap.
Diffstat (limited to 'games/larn/bill.c')
-rw-r--r-- | games/larn/bill.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/games/larn/bill.c b/games/larn/bill.c index dd74c11..4cf0cae 100644 --- a/games/larn/bill.c +++ b/games/larn/bill.c @@ -37,17 +37,14 @@ static char sccsid[] = "@(#)bill.c 5.2 (Berkeley) 5/28/91"; #include <sys/file.h> #include <sys/wait.h> -#include <string.h> -#include <stdlib.h> #include <stdio.h> -#include <unistd.h> #include "header.h" /* bill.c Larn is copyrighted 1986 by Noah Morgan. */ char *mail[] = { - "From: the LRS (Larn Revenue Service)\n", - "~s undeclared income\n", + "From: dev-null (the LRS - Larn Revenue Service)\n", + "Subject: undeclared income\n", "\n We have heard you survived the caverns of Larn. Let me be the", "\nfirst to congratulate you on your success. It was quite a feat.", "\nIt was also very profitable for you...", @@ -59,8 +56,8 @@ char *mail[] = { "\nmean penalties. Once again, congratulations, We look forward", "\nto your future successful expeditions.\n", NULL, - "From: His Majesty King Wilfred of Larndom\n", - "~s a noble deed\n", + "From: dev-null (His Majesty King Wilfred of Larndom)\n", + "Subject: a noble deed\n", "\n I have heard of your magnificent feat, and I, King Wilfred,", "\nforthwith declare today to be a national holiday. Furthermore,", "\nhence three days, ye be invited to the castle to receive the", @@ -68,15 +65,15 @@ char *mail[] = { "\n\nBravery and courage be yours.", "\n\nMay you live in happiness forevermore...\n", NULL, - "From: Count Endelford\n", - "~s You Bastard!\n", + "From: dev-null (Count Endelford)\n", + "Subject: You Bastard!\n", "\n I have heard (from sources) of your journey. Congratulations!", "\nYou Bastard! With several attempts I have yet to endure the", " caves,\nand you, a nobody, makes the journey! From this time", " onward, bewarned\nupon our meeting you shall pay the price!\n", NULL, - "From: Mainair, Duke of Larnty\n", - "~s High Praise\n", + "From: dev-null (Mainair, Duke of Larnty)\n", + "Subject: High Praise\n", "\n With certainty, a hero I declare to be amongst us! A nod of", "\nfavour I send to thee. Me thinks Count Endelford this day of", "\nright breath'eth fire as of dragon of whom ye are slayer. I", @@ -84,8 +81,8 @@ char *mail[] = { "\nunleash some of thy wealth upon those who be unfortunate, I,", "\nDuke Mainair, shall equal thy gift also.\n", NULL, - "From: St. Mary's Children's Home\n", - "~s these poor children\n", + "From: dev-null (St. Mary's Children's Home)\n", + "Subject: these poor children\n", "\n News of your great conquests has spread to all of Larndom.", "\nMight I have a moment of a great adventurers's time? We here at", "\nSt. Mary's Children's Home are very poor, and many children are", @@ -94,8 +91,8 @@ char *mail[] = { "\nin our plight? Whatever you could give will help much.", "\n(your gift is tax deductible)\n", NULL, - "From: The National Cancer Society of Larn\n", - "~s hope\n", + "From: dev-null (The National Cancer Society of Larn)\n", + "Subject: hope\n", "\nCongratulations on your successful expedition. We are sure much", "\ncourage and determination were needed on your quest. There are", "\nmany though, that could never hope to undertake such a journey", @@ -129,7 +126,7 @@ mailbill() sprintf(fname, "/tmp/#%dlarnmail", getpid()); for (i = 0; i < 6; i++) { if ((fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT), - 0666) == -1) + 0660) == -1) exit(0); while (*cp != NULL) { if (*cp[0] == '1') { @@ -146,7 +143,7 @@ mailbill() cp++; close(fd); - sprintf(buf, "mail -I %s < %s > /dev/null", + sprintf(buf, "/usr/sbin/sendmail %s < %s > /dev/null", loginname, fname); system(buf); unlink(fname); |