Cleanup help() a little bit. Use strlcat rather than strmcat.

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@385 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Tim Cava
2013-10-13 18:56:37 +00:00
parent 50d29b1f29
commit 9bc7e5c835

View File

@@ -5652,15 +5652,14 @@ BUILT_IN_COMMAND(returncmd)
BUILT_IN_COMMAND(help) BUILT_IN_COMMAND(help)
{ {
int cnt = 1; IrcCommand *cmd = NULL;
int cntdll = 0;
IrcCommand *cmd = NULL;
#ifdef WANT_DLL #ifdef WANT_DLL
IrcCommandDll *cmddll = NULL; IrcCommandDll *cmddll = NULL;
#endif #endif
int c, i; int cnt = 1, cntdll = 0, c, i;
char buffer[BIG_BUFFER_SIZE+1]; char *comm = NULL;
char *comm = NULL; char buffer[BIG_BUFFER_SIZE];
reset_display_target(); reset_display_target();
if (args && *args) if (args && *args)
{ {
@@ -5719,8 +5718,8 @@ char *comm = NULL;
c = 0; c = 0;
for (i = 0; i < cnt; i++) for (i = 0; i < cnt; i++)
{ {
strmcat(buffer, cmd[i].name, BIG_BUFFER_SIZE); strlcat(buffer, cmd[i].name, sizeof buffer);
strmcat(buffer, space, BIG_BUFFER_SIZE); strlcat(buffer, space, sizeof buffer);
if (++c == 5) if (++c == 5)
{ {
put_it("%s", convert_output_format("$G $[13]0 $[13]1 $[13]2 $[13]3 $[13]4", "%s", buffer)); put_it("%s", convert_output_format("$G $[13]0 $[13]1 $[13]2 $[13]3 $[13]4", "%s", buffer));
@@ -5731,8 +5730,8 @@ char *comm = NULL;
#ifdef WANT_DLL #ifdef WANT_DLL
for (i = 0; i < cntdll && cmddll; cmddll = cmddll->next, i++) for (i = 0; i < cntdll && cmddll; cmddll = cmddll->next, i++)
{ {
strmcat(buffer, cmddll->name, BIG_BUFFER_SIZE); strlcat(buffer, cmddll->name, sizeof buffer);
strmcat(buffer, space, BIG_BUFFER_SIZE); strlcat(buffer, space, sizeof buffer);
if (++c == 5) if (++c == 5)
{ {
put_it("%s", convert_output_format("$G $[13]0 $[13]1 $[13]2 $[13]3 $[13]4", "%s", buffer)); put_it("%s", convert_output_format("$G $[13]0 $[13]1 $[13]2 $[13]3 $[13]4", "%s", buffer));
@@ -5745,5 +5744,3 @@ char *comm = NULL;
put_it("%s", convert_output_format("$G $[13]0 $[13]1 $[13]2 $[13]3 $[13]4", "%s", buffer)); put_it("%s", convert_output_format("$G $[13]0 $[13]1 $[13]2 $[13]3 $[13]4", "%s", buffer));
userage("help", "%R[%ncommand%R]%n or /command -help %n to get help on specific commands"); userage("help", "%R[%ncommand%R]%n or /command -help %n to get help on specific commands");
} }