mirror of
https://github.com/curl/curl.git
synced 2026-08-24 11:03:36 +03:00
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:
parent
b228d2952b
commit
1c3e8bbfed
86 changed files with 413 additions and 226 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue