]> git.pond.sub.org Git - empserver/commitdiff
Don't write junk to unused bytes of downfil and motdfil
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 7 Feb 2009 18:49:21 +0000 (19:49 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Feb 2009 13:18:04 +0000 (14:18 +0100)
These files don't use all members of struct telstr.  turn() neglected
to initialized the unused ones and struct telstr's holes.  Fix that.

src/lib/commands/turn.c

index 64a32298fc8215f0b9494145e859ed638048bdb3..eef95bbadbbc82f119a1f1068e0749981ee9ec0c 100644 (file)
@@ -107,6 +107,7 @@ turn(void)
     if (msgfilepath == downfil)
        pr("Logins disabled.\n");
 
     if (msgfilepath == downfil)
        pr("Logins disabled.\n");
 
+    memset(&tgm, 0, sizeof(tgm));
     if ((fwrite(&tgm, sizeof(tgm), 1, fptr) != 1) ||
        (fwrite(msgbuf, tgm.tel_length, 1, fptr) != 1)) {
        fclose(fptr);
     if ((fwrite(&tgm, sizeof(tgm), 1, fptr) != 1) ||
        (fwrite(msgbuf, tgm.tel_length, 1, fptr) != 1)) {
        fclose(fptr);