更高MAAT_SET_SCAN_DISTRICT选项的参数要求,不再要求‘\0’结束。
This commit is contained in:
@@ -1491,7 +1491,7 @@ int Maat_set_scan_status(Maat_feather_t feather,scan_status_t* mid,enum MAAT_SCA
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
map_ret=map_str2int(_feather->scanner->district_map,(const char*)value,&(_mid->district_id));
|
||||
map_ret=map_unNullstr2int(_feather->scanner->district_map,(const char*)value,size,&(_mid->district_id));
|
||||
if(map_ret<0)
|
||||
{
|
||||
//May be the district is not effected yet.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "mesa_fuzzy.h"
|
||||
#include "great_index_engine.h"
|
||||
|
||||
int MAAT_FRAME_VERSION_1_8_20160909_TABLE_CONJ=1;
|
||||
int MAAT_FRAME_VERSION_1_8_20160918_TABLE_CONJ=1;
|
||||
const char *maat_module="MAAT Frame";
|
||||
|
||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
||||
|
||||
@@ -75,6 +75,24 @@ int map_str2int(MESA_htable_handle handle,const char* string,int* value)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
int map_unNullstr2int(MESA_htable_handle handle,const char* string,int len,int* value)
|
||||
{
|
||||
int *data=NULL;
|
||||
long cb_ret=0;
|
||||
|
||||
data=(int*)MESA_htable_search_cb(handle,(unsigned char*)string,len,
|
||||
read_map_val,value,&cb_ret);
|
||||
|
||||
// data=(int*)MESA_htable_search(handle,(unsigned char*)string,len);
|
||||
if(cb_ret>0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
void duplicate_func(const uchar * key, uint size, void * data, void * user)
|
||||
{
|
||||
MESA_htable_handle target=(MESA_htable_handle)user;
|
||||
|
||||
@@ -4,6 +4,7 @@ MESA_htable_handle map_create(void);
|
||||
void map_destroy(MESA_htable_handle p);
|
||||
int map_register(MESA_htable_handle handle,const char* string,int value);
|
||||
int map_str2int(MESA_htable_handle handle,const char* string,int* value);
|
||||
int map_unNullstr2int(MESA_htable_handle handle,const char* string,int size,int* value);
|
||||
MESA_htable_handle map_duplicate(MESA_htable_handle origin_map);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user