Skip to content

Commit 563cb03

Browse files
committed
Use sizeof string constant for constant parts
1 parent 2c73ec2 commit 563cb03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ibm_db2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,8 +2368,8 @@ static int _php_db2_connect_helper( INTERNAL_FUNCTION_PARAMETERS, conn_handle **
23682368
/* Check if we already have a connection for this userID & database combination */
23692369
if (isPersistent) {
23702370
zend_resource *entry;
2371-
/* 17 = strlen("FFFFFFFF") + strlen("__db2_") + strlen(".") + strlen(".") + null */
2372-
hKeyLen = strlen(database) + strlen(uid) + 17;
2371+
hKeyLen = strlen(database) + strlen(uid) +
2372+
sizeof("__db2_..FFFFFFFF"); /* constant part; includes null */
23732373
hKey = (char *) ecalloc(1, hKeyLen);
23742374

23752375
/* XXX: How do we include the options (array) in here too? */

0 commit comments

Comments
 (0)