diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-12-25 21:41:14 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-12-26 12:04:25 +0100 |
commit | ecbd1fa78dd5dd9a917424264fde259934ae4b59 (patch) | |
tree | 1d9ebeab1f083a8794aa646987561dcc438d70c5 /docs/examples/rtsp.c | |
parent | b8ef4a845be8cc2b82f3fbfee23f88b376655c0e (diff) | |
download | curl-bagder/NULL-checks.tar.gz |
checksrc: detect more kinds of NULL comparisons we avoidbagder/NULL-checks
Co-authored-by: Jay Satiro
Closes #8180
Diffstat (limited to 'docs/examples/rtsp.c')
-rw-r--r-- | docs/examples/rtsp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c index 6f27b57ed..ca6bcfe13 100644 --- a/docs/examples/rtsp.c +++ b/docs/examples/rtsp.c @@ -154,7 +154,7 @@ static void get_sdp_filename(const char *url, char *sdp_filename, { const char *s = strrchr(url, '/'); strcpy(sdp_filename, "video.sdp"); - if(s != NULL) { + if(s) { s++; if(s[0] != '\0') { snprintf(sdp_filename, namelen, "%s.sdp", s); @@ -171,8 +171,8 @@ static void get_media_control_attribute(const char *sdp_filename, char *s = malloc(max_len); FILE *sdp_fp = fopen(sdp_filename, "rb"); control[0] = '\0'; - if(sdp_fp != NULL) { - while(fgets(s, max_len - 2, sdp_fp) != NULL) { + if(sdp_fp) { + while(fgets(s, max_len - 2, sdp_fp)) { sscanf(s, " a = control: %32s", control); } fclose(sdp_fp); @@ -239,7 +239,7 @@ int main(int argc, char * const argv[]) /* initialize this curl session */ curl = curl_easy_init(); - if(curl != NULL) { + if(curl) { my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); my_curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); my_curl_easy_setopt(curl, CURLOPT_HEADERDATA, stdout); |