(gamedown, show_motd): Fix message buffer size. Messages of maximum
length were considered overlong and ignored.
This commit is contained in:
parent
8585ec930f
commit
e536b02c1c
2 changed files with 4 additions and 6 deletions
|
@ -154,7 +154,7 @@ gamedown(void)
|
||||||
{
|
{
|
||||||
FILE *down_fp;
|
FILE *down_fp;
|
||||||
struct telstr tgm;
|
struct telstr tgm;
|
||||||
s_char buf[MAXTELSIZE]; /* buf is message text */
|
char buf[MAXTELSIZE + 1]; /* message text */
|
||||||
|
|
||||||
if (player->god)
|
if (player->god)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -345,14 +345,12 @@ show_motd(void)
|
||||||
{
|
{
|
||||||
FILE *motd_fp;
|
FILE *motd_fp;
|
||||||
struct telstr tgm;
|
struct telstr tgm;
|
||||||
char buf[MAXTELSIZE];
|
char buf[MAXTELSIZE + 1]; /* message text */
|
||||||
|
|
||||||
if ((motd_fp = fopen(motdfil, "rb")) == NULL)
|
if ((motd_fp = fopen(motdfil, "rb")) == NULL) {
|
||||||
{
|
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
pr ("Could not open motd.\n");
|
pr ("Could not open motd.\n");
|
||||||
logerror("Could not open motd (%s).\n", motdfil);
|
logerror("Could not open motd (%s).\n", motdfil);
|
||||||
return RET_SYS;
|
return RET_SYS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue