X-Git-Url: http://git.jankratochvil.net/?p=vblib.git;a=blobdiff_plain;f=vblib.c;h=8850dc1c8a818b70f536122d811a8e2861057023;hp=9bf8ea19ee74ab912818957bf6a9233d63ec0fdc;hb=2855398ad0fd631f11c2395da59bc3941fa75e5f;hpb=d57add44b5aaae22106f668f2e4194e40a1fb084 diff --git a/vblib.c b/vblib.c index 9bf8ea1..8850dc1 100644 --- a/vblib.c +++ b/vblib.c @@ -801,14 +801,21 @@ char *chat_cmdpars[CHAT_CMD_MAXPARS]; static void chatfn_help(void); +void chatfn_quit(void) __WEAK; +void chatfn_quit(void) +{ + VB_LOG(CRIT,"chatfn_quit() not initialized"); +} + static const struct chat_cmdtab chat_cmdint[]={ {"help" ,0,chatfn_help ,"This help"}, -#if 0 {"quit" ,0,chatfn_quit ,"Close connection"}, {"exit" ,0,chatfn_quit ,"Close connection"}, -#endif }; +const struct chat_cmdtab chat_cmdtable[] __WEAK = + {{NULL,0,NULL,NULL}}; + static void chatfn_help(void) { int i; @@ -858,6 +865,10 @@ const struct chat_cmdtab *cmd,*cmdt; } chat_parsepars(s); cmdt=chat_cmdtable; + if (!cmdt || !cmdt->name) { + VB_LOG(CRIT,"chat_cmdtable not initialized, \"%s\" tried to execute \"%s\"",who,cmds); + return; + } for (i=0;iname) cmd=cmdt++; else cmd=&chat_cmdint[i++];