diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-31 11:40:25 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-31 11:40:25 +0000 |
commit | 3f536e31915aa2dc0771b74fa487f4ed76bc418c (patch) | |
tree | 78a9131999110bdeee8f50f57b9728de716d2658 /modules | |
parent | 159f69218dfbfc25dda011367da71826a97ca424 (diff) |
- m_help.c: Made dohelp() and sendhelpfile() void functions
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2973 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
-rw-r--r-- | modules/m_help.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/modules/m_help.c b/modules/m_help.c index 59e0805..ba7fbc4 100644 --- a/modules/m_help.c +++ b/modules/m_help.c @@ -37,7 +37,7 @@ #define HELPLEN 400 -static int +static void sendhelpfile(struct Client *source_p, const char *path, const char *topic) { FILE *file = NULL; @@ -47,7 +47,7 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return 0; + return; } if (fgets(line, sizeof(line), file) == NULL) @@ -55,7 +55,7 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); fclose(file); - return 0; + return; } line[strlen(line) - 1] = '\0'; @@ -73,11 +73,10 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) fclose(file); sendto_one(source_p, form_str(RPL_ENDOFHELP), me.name, source_p->name, topic); - return 0; } -static int -dohelp(struct Client *source_p, char *topic) +static void +do_help(struct Client *source_p, char *topic) { char *p = topic; char h_index[] = "index"; @@ -94,14 +93,14 @@ dohelp(struct Client *source_p, char *topic) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return 0; + return; } if (strlen(HPATH) + strlen(topic) + 1 > HYB_PATH_MAX) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return 0; + return; } snprintf(path, sizeof(path), "%s/%s", HPATH, topic); @@ -110,17 +109,17 @@ dohelp(struct Client *source_p, char *topic) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return 0; + return; } if (!S_ISREG(sb.st_mode)) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return 0; + return; } - return sendhelpfile(source_p, path, topic); + sendhelpfile(source_p, path, topic); } /* @@ -144,7 +143,8 @@ m_help(struct Client *client_p, struct Client *source_p, last_used = CurrentTime; - return dohelp(source_p, parv[1]); + do_help(source_p, parv[1]); + return 0; } /* @@ -155,7 +155,8 @@ static int mo_help(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - return dohelp(source_p, parv[1]); + do_help(source_p, parv[1]); + return 0; } static struct Message help_msgtab = |