From: Michael Wallner Date: Mon, 30 Jul 2012 18:33:55 +0000 (+0000) Subject: fix php_http_locate_bin_eol(() X-Git-Tag: RELEASE_2_1_0_RC3~10^2^2~112 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=302149963f42c5e839f34dfa79195d6fc441e279;p=m6w6%2Fext-http fix php_http_locate_bin_eol(() --- diff --git a/php_http_misc.h b/php_http_misc.h index 70dc090..972ba92 100644 --- a/php_http_misc.h +++ b/php_http_misc.h @@ -137,10 +137,10 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i { const char *eol; - for (eol = bin; eol - bin < len; ++eol) { + for (eol = bin; eol - bin <= len; ++eol) { if (*eol == '\r' || *eol == '\n') { if (eol_len) { - *eol_len = eol ? ((eol[0] == '\r' && eol[1] == '\n') ? 2 : 1) : 0; + *eol_len = ((eol[0] == '\r' && eol[1] == '\n') ? 2 : 1); } return eol; }