projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
e1bf249
)
fix long/int mismatch
author
Michael Wallner
<mike@php.net>
Sun, 2 Nov 2014 20:02:31 +0000
(21:02 +0100)
committer
Michael Wallner
<mike@php.net>
Thu, 6 Nov 2014 08:14:16 +0000
(09:14 +0100)
php_http_version.c
patch
|
blob
|
history
diff --git
a/php_http_version.c
b/php_http_version.c
index fbe94118cf53532bc603b52fbe46f160f14a3951..f4fcfc85367417dee7cb8f711fe39d89f18250b3 100644
(file)
--- a/
php_http_version.c
+++ b/
php_http_version.c
@@
-26,7
+26,7
@@
php_http_version_t *php_http_version_init(php_http_version_t *v, unsigned major,
php_http_version_t *php_http_version_parse(php_http_version_t *v, const char *str TSRMLS_DC)
{
php_http_version_t *php_http_version_parse(php_http_version_t *v, const char *str TSRMLS_DC)
{
-
php_http_version_t tmp
;
+
long major, minor
;
char separator = 0, *stop = NULL;
register const char *ptr = str;
char separator = 0, *stop = NULL;
register const char *ptr = str;
@@
-40,17
+40,17
@@
php_http_version_t *php_http_version_parse(php_http_version_t *v, const char *st
++ptr;
/* no break */
default:
++ptr;
/* no break */
default:
-
tmp.
major = strtol(ptr, &stop, 10);
- if (stop && stop != ptr &&
tmp.major != LONG_MIN && tmp.
major != LONG_MAX) {
+ major = strtol(ptr, &stop, 10);
+ if (stop && stop != ptr &&
major != LONG_MIN &&
major != LONG_MAX) {
separator = *stop;
if (separator) {
if (separator != '.' && separator != ',') {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Non-standard version separator '%c' in HTTP protocol version '%s'", separator, ptr);
}
ptr = stop + 1;
separator = *stop;
if (separator) {
if (separator != '.' && separator != ',') {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Non-standard version separator '%c' in HTTP protocol version '%s'", separator, ptr);
}
ptr = stop + 1;
-
tmp.
minor = strtol(ptr, &stop, 10);
- if (
tmp.minor != LONG_MIN && tmp.
minor != LONG_MAX) {
- return php_http_version_init(v,
tmp.major, tmp.
minor TSRMLS_CC);
+ minor = strtol(ptr, &stop, 10);
+ if (
minor != LONG_MIN &&
minor != LONG_MAX) {
+ return php_http_version_init(v,
major,
minor TSRMLS_CC);
}
}
}
}
}
}