checksrc: warn for assignments within if() expressions

... they're already frowned upon in our source code style guide, this
now enforces the rule harder.
This commit is contained in:
Daniel Stenberg 2016-12-14 01:29:44 +01:00
parent b228d2952b
commit 1c3e8bbfed
86 changed files with 413 additions and 226 deletions

View file

@ -715,10 +715,12 @@ const char *Curl_strerror(struct connectdata *conn, int err)
buf[max] = '\0'; /* make sure the string is zero terminated */
/* strip trailing '\r\n' or '\n'. */
if((p = strrchr(buf, '\n')) != NULL && (p - buf) >= 2)
*p = '\0';
if((p = strrchr(buf, '\r')) != NULL && (p - buf) >= 1)
*p = '\0';
p = strrchr(buf, '\n');
if(p && (p - buf) >= 2)
*p = '\0';
p = strrchr(buf, '\r');
if(p && (p - buf) >= 1)
*p = '\0';
if(old_errno != ERRNO)
SET_ERRNO(old_errno);
@ -1035,10 +1037,12 @@ const char *Curl_sspi_strerror (struct connectdata *conn, int err)
if(msg_formatted) {
msgbuf[sizeof(msgbuf)-1] = '\0';
/* strip trailing '\r\n' or '\n' */
if((p = strrchr(msgbuf, '\n')) != NULL && (p - msgbuf) >= 2)
*p = '\0';
if((p = strrchr(msgbuf, '\r')) != NULL && (p - msgbuf) >= 1)
*p = '\0';
p = strrchr(msgbuf, '\n');
if(p && (p - msgbuf) >= 2)
*p = '\0';
p = strrchr(msgbuf, '\r');
if(p && (p - msgbuf) >= 1)
*p = '\0';
msg = msgbuf;
}
if(msg)