mirror of
https://github.com/curl/curl.git
synced 2026-08-24 18:33:34 +03:00
checksrc: detect more kinds of NULL comparisons we avoid
Co-authored-by: Jay Satiro Closes #8180
This commit is contained in:
parent
acaa79f961
commit
21248e052d
36 changed files with 87 additions and 87 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -124,12 +124,12 @@ CURLcode create_dir_hierarchy(const char *outfile, FILE *errors)
|
|||
/* !checksrc! disable BANNEDFUNC 2 */
|
||||
tempdir = strtok(outdup, PATH_DELIMITERS);
|
||||
|
||||
while(tempdir != NULL) {
|
||||
while(tempdir) {
|
||||
bool skip = false;
|
||||
tempdir2 = strtok(NULL, PATH_DELIMITERS);
|
||||
/* since strtok returns a token for the last word even
|
||||
if not ending with DIR_CHAR, we need to prune it */
|
||||
if(tempdir2 != NULL) {
|
||||
if(tempdir2) {
|
||||
size_t dlen = strlen(dirbuildup);
|
||||
if(dlen)
|
||||
msnprintf(&dirbuildup[dlen], outlen - dlen, "%s%s", DIR_CHAR, tempdir);
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
#ifdef __NOVELL_LIBC__
|
||||
if(getenv("_IN_NETWARE_BASH_") == NULL)
|
||||
if(!getenv("_IN_NETWARE_BASH_"))
|
||||
tool_pressanykey();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ int fwrite_xattr(CURL *curl, int fd)
|
|||
int err = 0;
|
||||
|
||||
/* loop through all xattr-curlinfo pairs and abort on a set error */
|
||||
while(err == 0 && mappings[i].attr != NULL) {
|
||||
while(err == 0 && mappings[i].attr) {
|
||||
char *value = NULL;
|
||||
CURLcode result = curl_easy_getinfo(curl, mappings[i].info, &value);
|
||||
if(!result && value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue