projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** VERSION 5.3.0 ***
[NeonServV5.git]
/
src
/
cmd_global_motd.c
diff --git
a/src/cmd_global_motd.c
b/src/cmd_global_motd.c
index 275b3669de89511c163c11d34be8bc719d07bcc3..17c85034fbd21b7d34c9e28022aefa6de8effd8c 100644
(file)
--- a/
src/cmd_global_motd.c
+++ b/
src/cmd_global_motd.c
@@
-1,4
+1,4
@@
-/* cmd_global_motd.c - NeonServ v5.
2
+/* cmd_global_motd.c - NeonServ v5.
3
* Copyright (C) 2011 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* Copyright (C) 2011 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
@@
-24,11
+24,13
@@
CMD_BIND(global_cmd_motd) {
FILE *f;
f = fopen("motd.txt", "rb");
CMD_BIND(global_cmd_motd) {
FILE *f;
f = fopen("motd.txt", "rb");
- if(!f) return
0
;
+ if(!f) return;
char line[MAXLEN];
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);
}
if((a = strchr(line, '\n')))
*a = '\0';
reply(getTextBot(), user, "%s", line);
}
+ fclose(f);
}
\ No newline at end of file
}
\ No newline at end of file