diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-12-25 21:41:14 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-12-27 23:39:26 +0100 |
commit | 21248e052dbd0db33e8999aeeb919fb6f32c9567 (patch) | |
tree | 3345ae3b11c349ea56a58a387083fece2673e60c /src/tool_dirhie.c | |
parent | acaa79f961a6fd4cde83ea16b5fb85f0a32c7f23 (diff) | |
download | curl-21248e052dbd0db33e8999aeeb919fb6f32c9567.tar.gz |
checksrc: detect more kinds of NULL comparisons we avoid
Co-authored-by: Jay Satiro
Closes #8180
Diffstat (limited to 'src/tool_dirhie.c')
-rw-r--r-- | src/tool_dirhie.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index bf11005e0..93882d9b2 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -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); |