]> git.pond.sub.org Git - empserver/commitdiff
(gamedown, show_motd): Fix message buffer size. Messages of maximum
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jun 2005 09:25:22 +0000 (09:25 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jun 2005 09:25:22 +0000 (09:25 +0000)
length were considered overlong and ignored.

src/lib/player/empdis.c
src/lib/player/player.c

index 56a75163712384589cdc29422c40f927e3b73b09..3d0f52153c25453e43102d5890c260b91d61c918 100644 (file)
@@ -154,7 +154,7 @@ gamedown(void)
 {
     FILE *down_fp;
     struct telstr tgm;
-    s_char buf[MAXTELSIZE]; /* buf is message text */
+    char buf[MAXTELSIZE + 1];  /* message text */
 
     if (player->god)
        return 0;
index 519324220256853288162b58b25dbdc595fa210c..36db62dac347bd45db5f39aeb1090492c651b7d6 100644 (file)
@@ -345,14 +345,12 @@ show_motd(void)
 {
     FILE *motd_fp;
     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)
            return RET_OK;
-       else
-       {
+       else {
            pr ("Could not open motd.\n");
            logerror("Could not open motd (%s).\n", motdfil);
            return RET_SYS;