In this case we already know exactly where we need to write, no
need to use strncat at all.
memcpy(wildcard, filtername, len + 1); /* copy \0 */
period = wildcard + (period - filtername);
while (period) {
- *period = '\0';
- strncat(wildcard, ".*", 2);
+ ZEND_ASSERT(period[0] == '.');
+ period[1] = '*';
+ period[2] = '\0';
if (NULL != (fdat = zend_hash_str_find_ptr(BG(user_filter_map), wildcard, strlen(wildcard)))) {
period = NULL;
} else {
memcpy(wildname, filtername, n+1);
period = wildname + (period - filtername);
while (period && !filter) {
- *period = '\0';
- strncat(wildname, ".*", 2);
+ ZEND_ASSERT(period[0] == '.');
+ period[1] = '*';
+ period[2] = '\0';
if (NULL != (factory = zend_hash_str_find_ptr(filter_hash, wildname, strlen(wildname)))) {
filter = factory->create_filter(filtername, filterparams, persistent);
}