Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80883 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42180 invoked from network); 20 Jan 2015 18:00:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2015 18:00:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=git@internot.info; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=git@internot.info; sender-id=pass Received-SPF: pass (pb1.pair.com: domain internot.info designates 185.57.82.47 as permitted sender) X-PHP-List-Original-Sender: git@internot.info X-Host-Fingerprint: 185.57.82.47 mail.internot.info Received: from [185.57.82.47] ([185.57.82.47:54203] helo=mail.internot.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/71-32230-6C79EB45 for ; Tue, 20 Jan 2015 13:00:40 -0500 To: internals@lists.php.net Cc: Joshua Rogers Date: Wed, 21 Jan 2015 05:00:26 +1100 Message-ID: <1421776826-8333-1-git-send-email-git@internot.info> Subject: [PATCH] Remove useless tests From: git@internot.info (Joshua Rogers) Respective variables are unsigned and cannot be <0. --- sapi/litespeed/lsapilib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 2e60701..20279d1 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -1442,16 +1442,16 @@ int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen, in char * pBufCur = pBuf; char * pCur; char * p; - if (!pReq || (pReq->m_fd ==-1) ||( !pBuf )||(bufLen < 0 )|| !getLF ) + if (!pReq || (pReq->m_fd ==-1) ||( !pBuf )|| !getLF ) return -1; *getLF = 0; while( (left = pBufEnd - pBufCur ) > 0 ) { len = pReq->m_bufRead - pReq->m_bufProcessed; - if ( len <= 0 ) + if ( len = 0 ) { - if ( (len = readBodyToReqBuf( pReq )) <= 0 ) + if ( (len = readBodyToReqBuf( pReq )) = 0 ) { *getLF = 1; break; @@ -1486,7 +1486,7 @@ ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen ) ssize_t len; off_t total; /* char *pOldBuf = pBuf; */ - if (!pReq || (pReq->m_fd ==-1) || ( !pBuf )||(bufLen < 0 )) + if (!pReq || (pReq->m_fd ==-1) || ( !pBuf )) return -1; total = pReq->m_reqBodyLen - pReq->m_reqBodyRead; @@ -1517,7 +1517,7 @@ ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen ) pBuf += len; bufLen -= len; } - else if ( len <= 0 ) + else if ( len = 0 ) { if ( !total) return -1; -- 1.9.1