lidavidm commented on code in PR #1168:
URL: https://github.com/apache/arrow-adbc/pull/1168#discussion_r1347953295
##########
c/driver/common/utils.c:
##########
@@ -1007,7 +1007,8 @@ struct AdbcGetObjectsCatalog*
AdbcGetObjectsDataGetCatalogByName(
for (int64_t i = 0; i < get_objects_data->n_catalogs; i++) {
struct AdbcGetObjectsCatalog* catalog = get_objects_data->catalogs[i];
struct ArrowStringView name = catalog->catalog_name;
- if (!strncmp(name.data, catalog_name, name.size_bytes)) {
+ if ((int64_t)strlen(catalog_name) &&
Review Comment:
this check seems to be missing its RHS?
##########
c/driver/common/utils.c:
##########
@@ -1007,7 +1007,8 @@ struct AdbcGetObjectsCatalog*
AdbcGetObjectsDataGetCatalogByName(
for (int64_t i = 0; i < get_objects_data->n_catalogs; i++) {
struct AdbcGetObjectsCatalog* catalog = get_objects_data->catalogs[i];
struct ArrowStringView name = catalog->catalog_name;
- if (!strncmp(name.data, catalog_name, name.size_bytes)) {
+ if ((int64_t)strlen(catalog_name) &&
Review Comment:
you could factor out a `StringViewEquals(struct ArrowStringView, char*)` for
these checks to make it clearer if you want
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]