Skip to content

Commit 8dfe6bc

Browse files
committed
feedback
1 parent 14791ce commit 8dfe6bc

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

ext/soap/php_http.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,17 +1168,12 @@ int make_http_soap_request(
11681168
char *t = ZSTR_VAL(new_uri->path);
11691169
char *p = strrchr(t, '/');
11701170
if (p) {
1171-
zend_string *s = zend_string_alloc((p - t) + ZSTR_LEN(new_uri->path) + 2, 0);
1172-
memcpy(ZSTR_VAL(s), t, (p - t) + 1);
1173-
memcpy(ZSTR_VAL(s) + (p - t) + 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path) + 1);
1171+
zend_string *s = zend_string_concat2(t, (p - t) + 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path));
11741172
zend_string_release_ex(new_uri->path, 0);
11751173
new_uri->path = s;
11761174
}
11771175
} else {
1178-
zend_string *s = zend_string_alloc(ZSTR_LEN(new_uri->path) + 2, 0);
1179-
ZSTR_VAL(s)[0] = '/';
1180-
ZSTR_VAL(s)[1] = 0;
1181-
memcpy(ZSTR_VAL(s) + 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path) + 1);
1176+
zend_string *s = zend_string_concat2("/", 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path));
11821177
zend_string_release_ex(new_uri->path, 0);
11831178
new_uri->path = s;
11841179
}

0 commit comments

Comments
 (0)