Finally found this one: Recursive functions should not have static variables inside them. I should know that...

==32504==
==32504== Source and destination overlap in strcat(0x818ce00, 0x818ce03)
==32504==    at 0x4001FE12: strcat (mac_replace_strmem.c:87)
==32504==    by 0x80E8FDC: addtoken (common/util/umlaut.c:95)
==32504==    by 0x80E9029: addtoken (common/util/umlaut.c:92)
==32504==    by 0x80E9029: addtoken (common/util/umlaut.c:92)
This commit is contained in:
Enno Rehling 2004-02-12 22:59:11 +00:00
parent 5bd3875c8f
commit 84d304caab
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,6 @@ typedef struct tref {
void void
addtoken(tnode * root, const char* str, void * id) addtoken(tnode * root, const char* str, void * id)
{ {
static char zText[1024];
static struct replace { static struct replace {
char c; char c;
const char * str; const char * str;
@ -92,6 +91,7 @@ addtoken(tnode * root, const char* str, void * id)
addtoken(next->node, str+1, id); addtoken(next->node, str+1, id);
while (replace[i].str) { while (replace[i].str) {
if (*str==replace[i].c) { if (*str==replace[i].c) {
char zText[1024];
strcat(strcpy(zText, replace[i].str), str+1); strcat(strcpy(zText, replace[i].str), str+1);
addtoken(root, zText, id); addtoken(root, zText, id);
break; break;