Skip to content

Commit bd918b1

Browse files
committed
Use zend_string_equals() API instead of strcmp() in COM extension
1 parent e311d43 commit bd918b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/com_dotnet/php_com_dotnet_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ typedef struct _php_com_dotnet_object {
5151
static inline int php_com_is_valid_object(zval *zv)
5252
{
5353
zend_class_entry *ce = Z_OBJCE_P(zv);
54-
return strcmp("com", ce->name->val) == 0 ||
55-
strcmp("dotnet", ce->name->val) == 0 ||
56-
strcmp("variant", ce->name->val) == 0;
54+
return zend_string_equals_literal(ce->name, "com") ||
55+
zend_string_equals_literal(ce->name, "dotnet") ||
56+
zend_string_equals_literal(ce->name, "variant");
5757
}
5858

5959
#define CDNO_FETCH(zv) (php_com_dotnet_object*)Z_OBJ_P(zv)

0 commit comments

Comments
 (0)