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