Closed sunsetkookaburra closed 1 year ago
thx for flagging, I'll have a look as soon as time permits
It might also be helpful to call libcerror_error_set() for the other return values with a string explaining the table name couldn't be found.
The libesedb_file_get_table_by_utf8_name function is not intended to error when the table does not exist. This is what the return value of 0 is for, not finding the name is not considered an error condition for this function.
According to the doc comments, only -1, 0 or 1 is returned; however, I observed 2 (LIBUNA_COMPARE_GREATER) being returned. It is filtering up from the string comparison in libesedb_catalog_definition_compare_name_with_utf8_string and libuna_utf8_string_compare_with_byte_stream.
Confirmed looks like the result is not set to 0 when the table was not found.
Hello,
There is an edge case (either in documentation or logic) in
libesedb_file_get_table_by_utf8_name
andlibesedb_catalog_get_table_definition_by_utf8_name
that was discovered in https://github.com/sunsetkookaburra/rust-libesedb/issues/11.According to the doc comments, only
-1
,0
or1
is returned; however, I observed2
(LIBUNA_COMPARE_GREATER
) being returned. It is filtering up from the string comparison inlibesedb_catalog_definition_compare_name_with_utf8_string
andlibuna_utf8_string_compare_with_byte_stream
.It might also be helpful to call
libcerror_error_set()
for the other return values with a string explaining the table name couldn't be found. When I didn't see expected results, the first place I went looking for a cause was the error pointer passed in tolibesedb_file_get_table_by_utf8_name
, but of course it wasn't set and remainedNULL
.Thanks for your hard work and commitment over the years to this library.
- Oli