mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-13 16:47:58 +08:00
[svn-r13546]
Bug fix The H5TB_find_field function was not correctly finding a string field name amongst a string list of parameters of field names in cases where the name is similar up to n characters. Solution: added an extra verify condition with the string length Tested: kagiso, simple fix
This commit is contained in:
parent
dde381add4
commit
7aaf40e9f9
@ -3457,18 +3457,22 @@ out:
|
||||
static
|
||||
int H5TB_find_field( const char *field, const char *field_list )
|
||||
{
|
||||
const char *start = field_list;
|
||||
const char *end;
|
||||
|
||||
while ( (end = strstr( start, "," )) != 0 ) {
|
||||
if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1;
|
||||
start = end + 1;
|
||||
}
|
||||
|
||||
if ( strcmp( start, field ) == 0 ) return 1;
|
||||
|
||||
return -1;
|
||||
|
||||
const char *start = field_list;
|
||||
const char *end;
|
||||
|
||||
while ( (end = strstr( start, "," )) != 0 )
|
||||
{
|
||||
size_t count = end - start;
|
||||
if ( strncmp(start, field, count) == 0 && count == strlen(field) )
|
||||
return 1;
|
||||
start = end + 1;
|
||||
}
|
||||
|
||||
if ( strcmp( start, field ) == 0 )
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user