bug in setting error mask

This commit is contained in:
Ron Pedde 2004-11-13 20:59:10 +00:00
parent e24b0b7a66
commit bb14605b5c

View File

@ -186,9 +186,9 @@ void err_setdest(char *app, int destination) {
* \param list comma separated list of modules to debug. * \param list comma separated list of modules to debug.
*/ */
extern int err_setdebugmask(char *list) { extern int err_setdebugmask(char *list) {
char **pcurrent=err_categorylist;
unsigned int rack; unsigned int rack;
char *token, *str, *last; char *token, *str, *last;
int index;
err_debugmask=0x80000000; /* always log L_MISC! */ err_debugmask=0x80000000; /* always log L_MISC! */
str=list; str=list;
@ -199,12 +199,14 @@ extern int err_setdebugmask(char *list) {
if(token) { if(token) {
rack=1; rack=1;
while((*pcurrent) && (strcasecmp(*pcurrent,token))) { index=0;
while((err_categorylist[index]) &&
(strcasecmp(err_categorylist[index],token))) {
rack <<= 1; rack <<= 1;
pcurrent++; index++;
} }
if(!pcurrent) { if(!err_categorylist[index]) {
DPRINTF(E_LOG,L_MISC,"Unknown module: %s\n",token); DPRINTF(E_LOG,L_MISC,"Unknown module: %s\n",token);
return 1; return 1;
} else { } else {
@ -214,7 +216,7 @@ extern int err_setdebugmask(char *list) {
} else break; /* !token */ } else break; /* !token */
} }
DPRINTF(E_LOG,L_MISC,"Debug mask is 0x%08x\n",err_debugmask); DPRINTF(E_INF,L_MISC,"Debug mask is 0x%08x\n",err_debugmask);
return 0; return 0;
} }