Fix for static error lists

This commit is contained in:
Ron Pedde 2006-03-19 06:33:30 +00:00
parent 0b7968d468
commit 2882146e62
1 changed files with 7 additions and 2 deletions

View File

@ -183,11 +183,14 @@ void err_setdest(char *cvalue, int destination) {
extern int err_setdebugmask(char *list) {
unsigned int rack;
char *token, *str, *last;
char *tmpstr;
int index;
err_debugmask=0x80000000; /* always log L_MISC! */
str=list;
str=tmpstr=strdup(list);
if(!str)
return 0;
while(1) {
token=strtok_r(str,",",&last);
str=NULL;
@ -203,6 +206,7 @@ extern int err_setdebugmask(char *list) {
if(!err_categorylist[index]) {
DPRINTF(E_LOG,L_MISC,"Unknown module: %s\n",token);
free(tmpstr);
return 1;
} else {
DPRINTF(E_DBG,L_MISC,"Adding module %s to debug list (0x%08x)\n",token,rack);
@ -212,6 +216,7 @@ extern int err_setdebugmask(char *list) {
}
DPRINTF(E_INF,L_MISC,"Debug mask is 0x%08x\n",err_debugmask);
free(tmpstr);
return 0;
}