mirror of
https://github.com/curl/curl.git
synced 2026-08-04 14:56:19 +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
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ int SyncTime_CURL_Fetch(CURL *curl, char *URL_Str, char *OutFileName,
|
|||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, URL_Str);
|
||||
res = curl_easy_perform(curl);
|
||||
if(outfile != NULL)
|
||||
if(outfile)
|
||||
fclose(outfile);
|
||||
return res; /* (CURLE_OK) */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue