Use dynamic array instead static sring
This commit is contained in:
parent
1d9f8c3741
commit
d114b36c12
@ -2852,8 +2852,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
|
|||||||
if (CFG->scheckerenabled)
|
if (CFG->scheckerenabled)
|
||||||
{
|
{
|
||||||
schecker.Init(CFG->xlatlocalset, CFG->scheckerdicpath);
|
schecker.Init(CFG->xlatlocalset, CFG->scheckerdicpath);
|
||||||
char str[sizeof(AA->adat->scheckerdeflang)];
|
char *str = strdup(AA->adat->scheckerdeflang);
|
||||||
strncpy(str, AA->adat->scheckerdeflang, sizeof(str));
|
|
||||||
char *token = strtok(str, " ");
|
char *token = strtok(str, " ");
|
||||||
while(token != NULL)
|
while(token != NULL)
|
||||||
{
|
{
|
||||||
@ -2861,6 +2860,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
|
|||||||
/* Get next token: */
|
/* Get next token: */
|
||||||
token = strtok(NULL, " ");
|
token = strtok(NULL, " ");
|
||||||
}
|
}
|
||||||
|
free(str);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user