[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:
Pedro Vicente Nunes 2007-03-26 16:20:43 -05:00
parent dde381add4
commit 7aaf40e9f9

View File

@ -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;
}