PengZheng commented on code in PR #505:
URL: https://github.com/apache/celix/pull/505#discussion_r1160518229
##########
libs/utils/src/filter.c:
##########
@@ -415,6 +469,47 @@ celix_status_t filter_match(celix_filter_t * filter,
celix_properties_t *propert
return CELIX_SUCCESS;
}
+static int celix_filter_compareAttributeValue(const celix_filter_t* filter,
const char* propertyValue) {
+ if (!filter->internal->convertedToLong &&
!filter->internal->convertedToDouble && !filter->internal->convertedToVersion) {
+ return strcmp(propertyValue, filter->value);
+ }
+
+ if (filter->internal->convertedToLong) {
+ bool propertyValueIsLong = false;
+ long value = celix_utils_convertStringToLong(propertyValue, 0,
&propertyValueIsLong);
+ if (propertyValueIsLong) {
+ return (int) (value - filter->internal->longValue);
Review Comment:
Integer overflow happens.
--
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]