summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-25 15:21:53 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-25 15:21:53 +0000
commitb4d6bac9a4d623a9b32188458b26ae424d374bb3 (patch)
tree278b8f86ab39740f7b0dad0e726b10fc4198894a /src/map/atcommand.c
parentc842495d17863ebddaf64da006ceb642c70a9ad6 (diff)
downloadhercules-b4d6bac9a4d623a9b32188458b26ae424d374bb3.tar.gz
hercules-b4d6bac9a4d623a9b32188458b26ae424d374bb3.tar.bz2
hercules-b4d6bac9a4d623a9b32188458b26ae424d374bb3.tar.xz
hercules-b4d6bac9a4d623a9b32188458b26ae424d374bb3.zip
Corrected some weird fgets() statements, plus reformatted them
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10616 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 642a1f97e..87bf2a4d5 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -822,7 +822,8 @@ int msg_config_read(const char *cfgName)
if ((--called) == 0)
memset(msg_table, 0, sizeof(msg_table[0]) * MAX_MSG);
- while(fgets(line, sizeof(line)-1, fp)) {
+ while(fgets(line, sizeof(line), fp))
+ {
if (line[0] == '/' && line[1] == '/')
continue;
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2) {
@@ -884,7 +885,8 @@ int atcommand_config_read(const char *cfgName)
return 1;
}
- while (fgets(line, sizeof(line)-1, fp)) {
+ while(fgets(line, sizeof(line), fp))
+ {
if (line[0] == '/' && line[1] == '/')
continue;
@@ -2713,7 +2715,7 @@ int atcommand_help(const int fd, struct map_session_data* sd, const char* comman
if ((fp = fopen(help_txt, "r")) != NULL) {
clif_displaymessage(fd, msg_txt(26)); // Help commands:
gm_level = pc_isGM(sd);
- while(fgets(buf, sizeof(buf) - 1, fp) != NULL) {
+ while(fgets(buf, sizeof(buf), fp) != NULL) {
if (buf[0] == '/' && buf[1] == '/')
continue;
for (i = 0; buf[i] != '\0'; i++) {
@@ -2751,7 +2753,7 @@ int atcommand_help2(const int fd, struct map_session_data* sd, const char* comma
if ((fp = fopen(help2_txt, "r")) != NULL) {
clif_displaymessage(fd, msg_txt(26)); // Help commands:
gm_level = pc_isGM(sd);
- while(fgets(buf, sizeof(buf) - 1, fp) != NULL) {
+ while(fgets(buf, sizeof(buf), fp) != NULL) {
if (buf[0] == '/' && buf[1] == '/')
continue;
for (i = 0; buf[i] != '\0'; i++) {
@@ -7778,13 +7780,14 @@ int atcommand_gmotd(const int fd, struct map_session_data* sd, const char* comma
char buf[256];
FILE *fp;
nullpo_retr(-1, sd);
- if( (fp = fopen(motd_txt, "r"))!=NULL){
- while (fgets(buf, 250, fp) != NULL){
+ if((fp = fopen(motd_txt, "r"))!=NULL){
+ while(fgets(buf, sizeof(buf), fp) != NULL)
+ {
int i;
if (buf[0] == '/' && buf[1] == '/')
continue;
- for( i=0; buf[i]; i++){
- if( buf[i]=='\r' || buf[i]=='\n'){
+ for(i=0; buf[i]; i++){
+ if(buf[i]=='\r' || buf[i]=='\n'){
buf[i]=0;
break;
}