X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fcmd_global_motd.c;h=0340e47f768a1ab1d4b9e47ac1cb3157e70f5834;hb=bb5692b9cbff069abbf9573c81e86c3cd2061ceb;hp=275b3669de89511c163c11d34be8bc719d07bcc3;hpb=8e1495c30d7a78bbf3c66452ef2b8804d59e1b42;p=NeonServV5.git diff --git a/src/cmd_global_motd.c b/src/cmd_global_motd.c index 275b366..0340e47 100644 --- a/src/cmd_global_motd.c +++ b/src/cmd_global_motd.c @@ -1,5 +1,5 @@ -/* cmd_global_motd.c - NeonServ v5.2 - * Copyright (C) 2011 Philipp Kreil (pk910) +/* cmd_global_motd.c - NeonServ v5.3 + * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,11 +24,13 @@ CMD_BIND(global_cmd_motd) { FILE *f; f = fopen("motd.txt", "rb"); - if(!f) return 0; + if(!f) return; char line[MAXLEN]; - while (fgets(line, MAXLEN, fp) != NULL) { + char *a; + while (fgets(line, MAXLEN, f) != NULL) { if((a = strchr(line, '\n'))) *a = '\0'; reply(getTextBot(), user, "%s", line); } + fclose(f); } \ No newline at end of file