It is a bad idea to compare memory. This fixes some false-positives.
This commit is contained in:
parent
28dbeeb1ad
commit
0dc9a04f0e
2
vm.c
2
vm.c
|
@ -10768,7 +10768,7 @@ static int vm_builtin_import(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
||||||
return PH7_OK;
|
return PH7_OK;
|
||||||
}
|
}
|
||||||
while(SySetGetNextEntry(&pCtx->pVm->aModules, (void **)&pSearch) == SXRET_OK) {
|
while(SySetGetNextEntry(&pCtx->pVm->aModules, (void **)&pSearch) == SXRET_OK) {
|
||||||
if(SyMemcmp(pSearch->sName.zString, zStr, 0) == 0) {
|
if(SyStrncmp(pSearch->sName.zString, zStr, (sxu32)(SXMAX(pSearch->sName.zString, zStr))) == 0) {
|
||||||
SySetResetCursor(&pCtx->pVm->aModules);
|
SySetResetCursor(&pCtx->pVm->aModules);
|
||||||
ph7_result_bool(pCtx, 1);
|
ph7_result_bool(pCtx, 1);
|
||||||
return PH7_OK;
|
return PH7_OK;
|
||||||
|
|
Loading…
Reference in New Issue