projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- some minor strlen() and strlcat() tweaks
[m6w6/ext-http]
/
http_request_object.c
diff --git
a/http_request_object.c
b/http_request_object.c
index 7b1d82bec99ac92b1c4d3a909bea9d8f87a041af..37e2a58bd75c031f3b8a11828ca75ecf647b2eac 100644
(file)
--- a/
http_request_object.c
+++ b/
http_request_object.c
@@
-501,13
+501,13
@@
STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_
if (status == SUCCESS) {
zval *qdata = convert_to_type_ex(IS_STRING, GET_PROP(obj, queryData));
if (status == SUCCESS) {
zval *qdata = convert_to_type_ex(IS_STRING, GET_PROP(obj, queryData));
- if (Z_STRLEN_P(qdata)
&& (strlen(request_uri) < HTTP_URI_MAXLEN)
) {
+ if (Z_STRLEN_P(qdata)) {
if (!strchr(request_uri, '?')) {
if (!strchr(request_uri, '?')) {
- str
cat(request_uri, "?"
);
+ str
lcat(request_uri, "?", HTTP_URI_MAXLEN
);
} else {
} else {
- str
cat(request_uri, "&"
);
+ str
lcat(request_uri, "&", HTTP_URI_MAXLEN
);
}
}
- str
ncat(request_uri, Z_STRVAL_P(qdata), HTTP_URI_MAXLEN - strlen(request_uri)
);
+ str
lcat(request_uri, Z_STRVAL_P(qdata), HTTP_URI_MAXLEN
);
}
status = http_request_init(obj->ch, Z_LVAL_P(meth), request_uri, body, Z_ARRVAL_P(GET_PROP(obj, options)));
}
status = http_request_init(obj->ch, Z_LVAL_P(meth), request_uri, body, Z_ARRVAL_P(GET_PROP(obj, options)));